Billy-Sheppard / chart-js-rs

Rust Chart.js connector crate
https://billy-sheppard.github.io/chart-js-rs/examples/index.html
Apache License 2.0
25 stars 8 forks source link

Add suport for line chart #9

Open manthanrtilva opened 1 year ago

manthanrtilva commented 1 year ago

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

Billy-Sheppard commented 1 year ago

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.

DDtKey commented 9 months ago

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

Billy-Sheppard commented 9 months ago

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.

DDtKey commented 9 months ago

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