Skip to content
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

BarAndLineGraph line colour #57

Open
e22c opened this issue Jan 25, 2022 · 2 comments
Open

BarAndLineGraph line colour #57

e22c opened this issue Jan 25, 2022 · 2 comments
Assignees

Comments

@e22c
Copy link

e22c commented Jan 25, 2022

How to change colour of the line - marker's colour is as desired, but line is always the same - black.
I see the position of the line marker is always in the middle. Is it possible to fix it on middle of specific bar? If for example we have 5 bars and 1 line - line marker we want on bar 4? Is this possible?

Anyway great work.

@goat1000 goat1000 self-assigned this Jan 25, 2022
@goat1000
Copy link
Owner

The line colour on bar and line graphs comes from the colour functions - except when the stroke_colour option is set, then that is used instead.

For a graph with five bars and then a line dataset you could use this:

// black bar edges, red graph line
$settings['stroke_colour'] = ['#000', '#000', '#000', '#000', '#000', '#f00'];

or

// black bar edges, red-blue gradient graph line
$settings['stroke_colour'] = ['#000', '#000', '#000', '#000', '#000', ['#f00','#00f', 'h'];

There isn't a way to position the line markers over a specific bar at the moment - I'll add it to my list of things to work on for the next version.

@goat1000
Copy link
Owner

Changeset 099078b adds a new option for positioning the line markers over bars, line_bar. The default is null to leave the marker in the middle of the group, or you can set a bar number to centre the markers over, or use an array to position multiple line datasets over different bars.

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

No branches or pull requests

2 participants