Skip to content

allow more options to be defined on datasets, mainly bar and color #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 44 commits into
base: master
Choose a base branch
from

Conversation

ThomasBrodt
Copy link
Contributor

I made some changes to the 0.4.0 version of the timeline plugin, based on requirements we would like to implement with the timeline plugin. I would like to know what you think about that.

We are currently still on chartJs version 2.9.4 and this would be the required version for the modifications, too. (BTW, you've also started a branch for the 3.x version, is this already finished?)
This would require a version bump, because it may also breaks some existing use cases, mainly the use of colorFunction.

It would offer some new features, though, a new demo file dataset-colors.html shows some examples:

  • support of categoryPercentage, barPercentage, barThickness, maxBarThickness on a dataset level
  • colors may defined on a dataset/dataElement level like with regular bar charts
  • color definitions include backgroundColor, borderColor, borderWidth, hoverBackgroundColor, hoverColor, hoverBorderWidth
  • colorFunction is no longer supported, though
  • keyStart/End/Value can be defined on the dataset level
  • updates of some used functions borrowed from BarController to those of the 2.9.4 version

@fanthos
Copy link
Owner

fanthos commented May 10, 2021

Thanks for the PR.
Currently I have no enough time to review the PR and test the code. Will do it later.

The 3.0 branch was not complete and targeted on old beta version ChartJS. Upstream changed how plugins works(i.e. remove babel on compile), so more fix should be done to make it working on 3.0.

@bramkragten
Copy link

bramkragten commented Jun 10, 2021

I did a version that works with Chart.js 3, but it is far from ready to make a PR, it is pretty breaking and was tailored for our own use case.

Will try to make a PR out of it.

https://github.com/home-assistant/frontend/blob/c4e4d961e336bc6e7cfdd672a22689c3c8da57c3/src/components/chart/chart-type-timeline.ts

@fanthos
Copy link
Owner

fanthos commented Jun 15, 2021

Another thing, this plugin should use date adapter instead of moments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants