c3js / c3

:bar_chart: A D3-based reusable chart library
http://c3js.org
MIT License
9.35k stars 1.39k forks source link

Cumulative Line Chart #243

Open alexis-pasialis opened 10 years ago

alexis-pasialis commented 10 years ago

How hard would it be to implement something like the example found at:

http://nvd3.org/examples/cumulativeLine.html

Thanks

masayuki0812 commented 10 years ago

Hi, Thank you for your suggestion, but I think this can be done by generating the cumulative data before generating the chart, so I think this would not be needed as a feature of c3.

alexis-pasialis commented 10 years ago

Hi, I don't think it's a matter of pre-generating the cumulative data. Please click at any point in the chart to see what I mean. Re-scaling to a new 100 starting point is very valuable for financial charts.

Thanks

masayuki0812 commented 10 years ago

Hi, Thank you, you're right. Actually I think we need to implement for this purpose. I'll consider as a new feature.

alexis-pasialis commented 10 years ago

That's great news, thank you for this! How long do you think it will take?

alexis-pasialis commented 10 years ago

Hi again. Any progress on this? Sorry to ask again, I need this feature cause I have a deadline and I don't want to waste time on implementation or another library migration. Thanks

masayuki0812 commented 10 years ago

Hi, Sorry for late response and I can't implement this feature soon. However, I think you can do this by calling a function that loads new cumulative data on onclick event. Though you have to generate cumulative data by yourself, it seems the easiest way now. The code would be:

c3.generate({
  ...
  data: {
    onclick: function (d) {
      // generate new cumulative data by using d
      this.load({
        columns: cumulativeData
      });
    }
  },
  ...
});
aendra-rininsland commented 9 years ago

Although this seems pretty resolved, having such a chart might be a good candidate for a plugin. Alas, until #351 is complete, that is not possible. Adding on hold and closing, will reopen once plugin infrastructure is in place.

aendra-rininsland commented 9 years ago

Reopening after discussion with @masayuki0812 re: how to handle on hold issues.