chart-js-rs icon indicating copy to clipboard operation
chart-js-rs copied to clipboard

Add suport for line chart

Open manthanrtilva opened this issue 2 years ago • 4 comments

This PR add support to plot line chart. Add example for line chart.

manthanrtilva avatar Apr 25 '23 06:04 manthanrtilva

Thanks for contributing!

Line charts are available by leveraging scatter plots, can you explain how this is different? I don't want to add extra chart types if they can be done with the existing set.

It might be worth me adding a line example to the code using the scatter plot code, I would be happy to do that if this isn't merged.

Billy-Sheppard avatar Apr 26 '23 06:04 Billy-Sheppard

Hi there!

As far as I understand to use Scatter instead of Line chart we need to be able to set showLine: true, but currently I don't see this property.

The scatter chart supports all the same properties as the line chart. By default, the scatter chart will override the showLine property of the line chart to false.

And in general, it could work just by setting r#type: "line", but it's not possible ofc due to private types and it makes sense. But would be nice to have wrapper for Line charts or add showLine config at least

DDtKey avatar Jan 21 '24 18:01 DDtKey

Hi @DDtKey!

I've added a line chart to the examples, please let me know if this is not suitable for your use case/doesn't answer your question.

Billy-Sheppard avatar Jan 21 '24 22:01 Billy-Sheppard

Thanks @Billy-Sheppard, it works as expected to me

DDtKey avatar Jan 22 '24 14:01 DDtKey