This project is read-only.

Axis stroke/brush

Mar 11, 2014 at 1:41 PM
I'm fighting with the library over a week now, and still for the love of god I cannot find any way to change the color of the axes and the crossline. Could someone please point me in the right direction?
Coordinator
Mar 11, 2014 at 2:04 PM
Hi,

You could change the axis and crosslines color through the following code
<Style TargetType="Line" x:Key="crossLineStyle">
            <Setter Property="Stroke" Value="#FFAAFFAA"/>
            <Setter Property="StrokeThickness" Value="1"/>
        </Style>
        <Style TargetType="Line" x:Key="axisLineStyle">
            <Setter Property="Stroke" Value="#FFAAFFAA"/>
            <Setter Property="StrokeThickness" Value="0"/>
        </Style>
        <Style TargetType="Line" x:Key="minorcrossLineStyle">
            <Setter Property="Stroke" Value="#FF225633"/>
            <Setter Property="StrokeThickness" Value="0.25"/>
        </Style>
<chart:SparrowChart.XAxis>
                <chart:LinearXAxis CrossLineStyle="{StaticResource crossLineStyle}" MinorLineStyle="{StaticResource minorcrossLineStyle}" MajorLineStyle="{StaticResource crossLineStyle}" AxisLineStyle="{StaticResource axisLineStyle}" MinValue="2" MinorTicksCount="3" MaxValue="5"  ShowCrossLines="True" Header="Time" StringFormat="0.0"/>
            </chart:SparrowChart.XAxis>
            <chart:SparrowChart.YAxis>
                <chart:LinearYAxis CrossLineStyle="{StaticResource crossLineStyle}"  MinorLineStyle="{StaticResource minorcrossLineStyle}" MajorLineStyle="{StaticResource crossLineStyle}" AxisLineStyle="{StaticResource axisLineStyle}" MinValue="-15" MinorTicksCount="3" MaxValue="15" ShowCrossLines="True" StringFormat="0.0" Header="Voltage(mV)" >
                </chart:LinearYAxis>
            </chart:SparrowChart.YAxis>
Thanks,
Vinoth Kumar J
Marked as answer by gohanks on 3/11/2014 at 6:45 AM
Mar 11, 2014 at 2:45 PM
Thank you very much :). So simple yet somehow never crossed my mind.