Skip to content

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

Open
ThomasBrodt wants to merge 44 commits into
fanthos:masterfrom
ThomasBrodt:master
Open

allow more options to be defined on datasets, mainly bar and color #35
ThomasBrodt wants to merge 44 commits into
fanthos:masterfrom
ThomasBrodt:master

Conversation

@ThomasBrodt

Copy link
Copy Markdown
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

fanthos commented May 10, 2021

Copy link
Copy Markdown
Owner

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

bramkragten commented Jun 10, 2021

Copy link
Copy Markdown

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

fanthos commented Jun 15, 2021

Copy link
Copy Markdown
Owner

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