Pre loader

Show only XAxis and YAxis without labels and without gridlines

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

Hi,

I’m actually working on new wpf application using Scichart and I’m wondering how to plot only XAxis and YAxis without labels and without gridlines.

Here is my code, I cannot not figure out what is missing to do that:

            <s:SciChartSurface.YAxis>
                <s:NumericAxis VisibleRange="{Binding ...}"
                               MajorGridLineStyle="{Binding ...}"
                               TickLabelStyle="{Binding ...}"
                               MajorDelta="{Binding ...}"
                               MinorDelta="1"
                               AutoTicks="False"
                               AxisAlignment="Left"
                               DrawMajorGridLines="false
                               DrawMinorGridLines="false"
                               DrawMajorBands="false"
                               DrawMajorTicks="false"
                               DrawMinorTicks="false"
                               DrawLabels="false"
            </s:SciChartSurface.YAxis>


        <Style x:Key="NoGraphGridLineStyle" TargetType="s:NumericAxis">
            <Setter Property="Visibility" Value="Collapsed" />
        </Style>
Version
6.x
  • Hasdrubal Barca
    Unfortunately, it doesn’t help, I have changed the style applied to the style property of NumericAxis but it doesn’t help also, steel have no axes drawn.
  • You must to post comments
0
0

Hi there ,

Setting properties on Axis:

DrawMajorGridLines="false"
DrawMinorGridLines="false"
DrawMajorBands="false"
DrawMajorTicks="false"
DrawMinorTicks="false"
DrawLabels="false"

is exactly how to disable gridlines and labels. We demonstrate this in our example ‘Modify Axis Behaviour’

https://www.scichart.com/example/wpf-chart-example-modify-axis-properties/

enter image description here

Let me know if this helps

Best regards,
Andrew

  • You must to post comments
0
0

Play around with something like the following… I use a separate SciChart.xaml file to store all my ChartSurface styles and reference it from my app.xaml as a merged resource. Then you can just reference it as a style (I’m sure you already understand that part).

            <s:SciChartSurface.XAxis>
            <s:NumericAxis x:Name="BottomAxis" AutoRange="{Binding Path=XAutoRange}"                               
                               FlipCoordinates="False"
                               GrowBy="0.05, 0.05"
                               ScientificNotation="None" 
                               s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
                               s:CursorModifier.AxisLabelTemplate="{StaticResource MyCursorXAxisLabelTemplate}"
                               Style="{DynamicResource ResourceKey=MyXaxisStyle}" />
        </s:SciChartSurface.XAxis>


    <Style x:Key="MyXaxisStyle" TargetType="s:AxisBase">
    <Setter Property="FontFamily" Value="Arial" />
    <Setter Property="FontSize" Value="12" />
    <Setter Property="FontWeight" Value="Normal" />
    <Setter Property="TickTextBrush" Value="Gray"/>
    <Setter Property="DrawMajorBands" Value="False"/>
    <Setter Property="DrawMajorGridLines" Value="False" />
    <Setter Property="DrawMinorGridLines" Value="False" />
    <Setter Property="AxisBandsFill" Value="White"/>

    <Setter Property="MinorTickLineStyle">
        <Setter.Value>
            <Style TargetType="Line">
                <Setter Property="Stroke" Value="Gray"/>
                <Setter Property="StrokeThickness" Value="1"/>
                <Setter Property="X2" Value="4"/>
                <Setter Property="Y2" Value="4"/>
            </Style>
        </Setter.Value>
    </Setter>

</Style>
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies