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

Having multiple colour bands with an area that changes dynamically over time #336

Closed
dddppp opened this issue Sep 1, 2015 · 7 comments
Closed

Comments

@dddppp
Copy link

dddppp commented Sep 1, 2015

Hello,

I have found this chart library for iOS and I really like it. It has slick animations and seem to be polished and modern. I am trying to use it for a test project and wanted to ask you if it is possible to create a graph that has 4 (or more) colour bands that have an area that changes dynamically over time (based on some dynamic property - not x or y value).
output_nnki1p

I attach a quick sketch. Image the x axis being the time and y axis being the values (from 0-100). The area of the 4 bands will change depending on some parameter that will change over time.

For example at time 0 the black area upper limit may be 30, the white area may go from 30 to 50, the green area from 50 to 70 and the orange area from 70 to 100. At time 0+x these limits may change.

Importantly the area should be coloured only until the current time (E.g. until x = 50) like in the current example and then as time progresses the area should change according to the x,y value (please see attached files).

Is this possible with this library?

@liuxuan30
Copy link
Member

I am guessing the line chart could help you, it has filling features to render as the color band. But maybe you need to override some methods to achieve the visual effects you want.

@danielgindi
Copy link
Collaborator

To me it looks like a stacked bar chart...

@dddppp
Copy link
Author

dddppp commented Sep 7, 2015

Hello, I have been trying this approach using a bar chart and is the best approximation possible. Ideally I need to find a way to make the bar wider and remove the white border from it so it looks more uniform.. any idea on how I can do it?

@danielgindi
Copy link
Collaborator

Well you can adjust the bar spacing, and the bar width.
Also if you really want several coloured lines, you could just use multiple datasets in a LineChart

@dddppp
Copy link
Author

dddppp commented Sep 7, 2015

Hello, the issue I got is that I need a line to show some data and the 3 changing bars to show where the data fits. So the line has a neutral colour and can have at time x a value y, which at time x corresponds to colour green but then at time x+n it could correspond to colour red even if y is the same. Thanks for replying.

@liuxuan30
Copy link
Member

You need the line to swtich stroke color between the dots? like -red-green-yellow-? It still sounds you need to override the chart renderer to get what you want.

@liuxuan30
Copy link
Member

Closing - feel free to reopen it for more questions.

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

3 participants