最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to prevent any aggregation in dimple.js? (skip aggregateMethod) - Stack Overflow

programmeradmin3浏览0评论

I have a dimple.js line plot that plots a serie of cumulated values over time, using addTimeAxis on x and addMeasureAxis on y.

There is one value per day, except for the current day, where there are two values that I want to keep as distinct data points: booked and forecasted (e.g. precipitations or else), a vertical line having to be traced between these two values.

Dimple aggregates the values using aggregateMethod, whose default mode is "sum". .aggregateMethod

In my case, this has the effect of merging the to data points (booked / forecasted) into a unique data point. For instance, if the booked cumulated amount is 1250 and the forecasted cumulated amount at the end of the day is 1350, instead of keeping the two data points, it creates one at unique point at the height of 2600 (the sum of 1250 and 1350).

The issue, that I illustrated in this post, revealed specific to dimple aggregating data points.

I want to either avoid any call aggregateMethod for this plot, or create a "void" aggregateMethod that I would set as aggregateMethod.none. To keep the two data points distinct at same x value (i.e. date) am not sure if I have to create a new blank/void aggregateMethod mode in dimple.js, and even if I have to prevent aggregation somewhere else.


Unsucessfully attempted:

  • Setting aggregateMethod to "count" mode: lineplot_resultat_cumule.series[0].aggregate = dimple.aggregateMethod.count; simply counts the number of records, for each x value, i.e. in my case the number of records per day (1 or 2).

  • Commenting out dimple.aggregateMethod.sum and plotFunction.stacked around line 1565 of dimple.js:

     // Create a series object
     series = new dimple.series(
         this,
         categoryFields,
         xAxis,
         yAxis,
         zAxis,
         colorAxis,
         pieAxis,
         plotFunction,
         //dimple.aggregateMethod.sum,
         //plotFunction.stacked
     );
    
发布评论

评论列表(0)

  1. 暂无评论