timqian / chart.xkcd

xkcd styled chart lib
https://timqian.com/chart.xkcd/
MIT License
7.61k stars 200 forks source link

[new chart type]: combined chart #22

Open Dkalugin opened 4 years ago

Dkalugin commented 4 years ago

Issuehunt badges

Hello! Can I build a combined chart like a screenshot? https://tetis-capital.ru/upload/image/chart.png


IssueHunt Summary ### Backers (Total: $50.00) - [issuehunt issuehunt](https://issuehunt.io/u/issuehunt) ($50.00) #### [Become a backer now!](https://issuehunt.io/r/timqian/chart.xkcd/issues/22) #### [Or submit a pull request to get the deposits!](https://issuehunt.io/r/timqian/chart.xkcd/issues/22) ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/timqian/chart.xkcd/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds. --- IssueHunt has been backed by the following sponsors. [Become a sponsor](https://issuehunt.io/membership/members)
issuehunt-oss[bot] commented 4 years ago

@issuehunt has funded $50.00 to this issue.


rahgurung commented 4 years ago

So, I'm planning to make a new Combined.js in the src and then build it as a separate new chart or you want me to re-use the Bar and Line code, is that possible in some way?

timqian commented 4 years ago

@gurrrung Thanks for the interest, I think we should re-use the Bar and Line code in some way, so we won't need to copy-paste code around when the charts changes(e.g. https://github.com/timqian/chart.xkcd/issues/27), but the current implementation of them is not easy to be reused, we may need to refactor the code a little

Suggestions on the refactoring are welcomed

Ref: How chart.js implement mixed type chart https://www.chartjs.org/docs/latest/charts/mixed.html