Welcome Guest Search | Active Topics |

Color intervals
mattti
#1 Posted : Thursday, March 06, 2014 5:22:53 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/6/2014(UTC)
Posts: 4

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hi,

is there any option to make series line change color(or other line properties eventually) at specific x-axis intervals(or just set the color at some data point while creating model)? E.g I'd like to be able to

1.) make the LineChart with datetime x-axis values ranging from 2013-01-01 to 2014-01-01 and be able to set different line colors for different datetime ranges: Red color for interval 2013-01-01 - 2013-02-01, blue one for interval 2013-04-01 - 2013-05-10 etc.

or

2.) make color changes in data model like this:

Code:

data.Add(new ChartModel(new DateTime(2014, 2, 1), 1, 5, Color.Red));//red line from this datapoint
data.Add(new ChartModel(new DateTime(2014, 2, 2), 2, 10));
data.Add(new ChartModel(new DateTime(2014, 2, 3), 1, 2, Color.Blue));//blue line from this datapoint
data.Add(new ChartModel(new DateTime(2014, 2, 3), 10, 35));


Right now I'm only able to make different line colors by creating series for each color. But the number of colors would be limited because you can add only 2 series(am i right?), and yet i would like to add two independent series, each one composed of different colors.

Thanks for your replies, solutions
Ivan
#2 Posted : Friday, March 07, 2014 4:24:11 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
Currently, you need to add separate series for each color. You can add as many series as you want.
Best,
Ivan Petrov
jqChart Inc.
geotruck
#3 Posted : Thursday, October 16, 2014 5:49:54 AM(UTC)
Rank: Newbie

Groups: MvcChart, Registered
Joined: 8/11/2014(UTC)
Posts: 5

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
I used this approach but i had to make some ugly hacks to make it work for me.

For example: I have one logical series and i split it to two different series with different color. I need to preserve "NullHandling.Connect" behaviour so that there are no empty spaces in line. If you set "NullHandling.Connect" on your two series you'll get two unmatching lines because the chart is connecting different points(different X and Y value).

My solution: Im adding fake points to each of the series in the place of the change. If color is changing from red to blue, I'm adding red point to red series with X and Y values from blue point and vice versa. And I need to set "NullHandling.Break" on both series
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.122 seconds.