Hi,
I have an XamDataChart with a vertical green line (ValueOverlay), and I would like to set a gradient (white-green) background for the XamDataChart so that it extends only up to the green line. How can this be achieved, if possible?
Thank you :)
Hello Julianna,
If you would like to set a background on the XamDataChart, you can utilize the PlotAreaBackground property of the chart, but the ValueOverlay will always extend the length of the chart in the direction that it is configured (vertical or horizontal).
If you are trying to configure the ValueOverlay to only extend to a particular set of Y-Axis values, this may be very complicated to try to do with a gradient brush with the PlotAreaBackground. I am curious if you have a mock-up or screenshot of what you are looking to achieve here that you can attach, as perhaps I can make a more concrete recommendation from that?
Hi, thank you for your answer. I would like something like this. Now opting for a solution without the ValueOverlay instead. :)
You can achieve a chart that looks like your screenshot by using the following code:
<ig:XamDataChart> <ig:XamDataChart.PlotAreaBackground> <LinearGradientBrush StartPoint="0,1" EndPoint="1,0"> <LinearGradientBrush.GradientStops> <GradientStop Offset="0" Color="White" /> <GradientStop Offset="1" Color="LightGreen" /> </LinearGradientBrush.GradientStops> </LinearGradientBrush> </ig:XamDataChart.PlotAreaBackground> <!-- Series and Axes Here --> </ig:XamDataChart>
Please let me know if you have any other questions or concerns on this matter.
Hello Andrew,
Thank you so much :)