|
addInterLineLayer but not just between 2 lines |
Posted by Massimo Brillante on May-07-2013 01:20 |
|
Hi,
I need to fill 2 zones on one chart: see attached mockup image.
I am aware of the addInterLineLayer, but the problem I am having is to fill the zone from the base of the X axis to the diastolic line
for the systolic fill I can use the two marks (dotted lines) but what I can use for the base of the axis to the diastolic line ?
|
Re: addInterLineLayer but not just between 2 lines |
Posted by Massimo on May-07-2013 15:09 |
|
I figure it out by adding a dummy mark at 0 position on the Y axis.
now I am getting nuts with colours; this is the one from the example which is a light green
0x8099ff99
I need to find a darker shade of green but transparent; I Google it for transparent ex colours and seems like I have to add another byte to it but I cannot figure it out
attached the chart with the 2 filled colours I am using : 0x8099ff99 and the wrong one 0x32cd32cd.
There is any online chart for these colours or how can I make then up ?
|
Re: addInterLineLayer but not just between 2 lines |
Posted by Massimo on May-07-2013 15:19 |
|
I found this forum
http://www.telerik.com/support/kb/aspnet-ajax/chart/setting-hexadecimal-value-for-color-transparency-of-radchart-elements.aspx
so I choose 50% (127) which turns to be 7F and it works, however by having 0x7f32cd32 as value, resharper is suggesting to me to take off the int cast as redundant so rather tuna having
c.addInterLineLayer(mark_0.getLine(), mark_1.getLine(), unchecked((int)0x7f32cd32), unchecked((int)0x7f32cdcd));
I should have
c.addInterLineLayer(mark_0.getLine(), mark_1.getLine(), unchecked(0x7f32cd32), unchecked(0x7f32cdcd));
it works.. but I am doing it right ? |
Re: addInterLineLayer but not just between 2 lines |
Posted by Peter Kwan on May-07-2013 17:37 |
|
Hi Massimo,
Accordng to C# syntax, 0x7f32cd32, (int)0x7f32cd32, unchecked(0x7f32cd32) and unchecked((int)0x7f32cd32) are exactly the same. So you can use anyone of them and it does not matter. In other words, for 0x7f32cd32, the "(int)" and "unchecked" are not necessary but they do not cause any issue.
The "unchecked" and "(int)" are necessary if your numbers are not interpreted as "int" by default as according to C# syntax. For example, 0x80123456 is not an "int" by default as according to C# syntax, so you need to use "unchecked((int) ....)" to tell C# that the number should be treated as an "int".
Hope this can help.
Regards
Peter Kwan |
Re: addInterLineLayer but not just between 2 lines |
Posted by Massimo on May-07-2013 18:06 |
|
crystal clear as usual !!
Thanks. |
|