SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

Hi there,

I am new to the SciChart. Could you please tell me what is the name of “x-Axis” in SciStockChart?
Since from your example, you used SciChartSurface. The Checkbox syntax shows below. The ElementName is xAxis.

CheckBox Margin=”3″ Content=”Draw Major Gridlines” IsChecked=”{Binding ElementName=xAxis, Path=DrawMajorGridLines, Mode=TwoWay}”/>

… …

s:SciChartSurface.XAxis>
s:DateTimeAxis x:Name=”xAxis” VisibleRangeChanged=”OnXVisibleRangeChanged”>
/s:SciChartSurface.XAxis>

But I can not find or change the name property in SciStockChart. Could you please tell me what ElementName should I use? Or if there are other ways to achieve this. Thank you very much!

Version
4.2.3
  • You must to post comments
0
0

Hi Dexin,

The SciStockChart inherits SciChartSurface and adds some defaults for stock chart developers.

To access the XAxis (which is declared internally) and change properties, you do so via the SciStockChart.XAxisStyle property. Have a look here for a code sample.

Let me know if this helps!

Best regards,
Andrew

  • Dexin Wang
    Thank you for your reply! I have seen this sample many times and I know how to change the property in XAxisStyle. I just wanted to know when I use a checkbox, how to bind the “checkbox” to “DrawMajorGridLines” in SciStockChart. Thank you! And your kid is very cute.
  • Andrew
    Bind from style setter to the checkbox or to a property in the view model. e.g. <Setter Property=”DrawMajorGridLines” Value=”{Binding ElementName=myCheckBox, Path=IsChecked, Mode=TwoWay}”/>
  • Dexin Wang
    Hi Andrew, Thank you for your reply! Here I first name the checkbox “myCheckBox” and then bind “DrawMajorGridLines” to “myCheckBox” through setter property like what you said. But it still does not work. The Gridlines are always there. Could you please tell me the reason? Thank you! BTW, we have your license.
  • Dexin Wang
    Thank you Andrew, I solved it in C#.
  • You must to post comments
0
0

Hi Andrew, Thank you for your reply! Here I first name the checkbox “myCheckBox” at left side toolbar and then bind “DrawMajorGridLines” to “myCheckBox” through setter property like what you said. But it still does not work. The Gridlines are always there. Could you please tell me the reason? Thank you!

     <ext:FlyoutMenuButton HorizontalAlignment="Left" Content="XAxis Controls" Padding="0" Style="{StaticResource FlyoutMenuButtonStyle}" ToolTipService.ToolTip="XAxis Controls">
          <ext:FlyoutMenuButton.PopupContent>
              <StackPanel MinWidth="150" Orientation="Vertical">
                  <TextBlock Text="XAxis Controls"/>
                  <CheckBox x:Name="myCheckBox" Margin="3" Content="Draw Major Gridlines"  IsChecked="True" />
              </StackPanel>
          </ext:FlyoutMenuButton.PopupContent>
      </ext:FlyoutMenuButton>

      <s:SciStockChart.XAxisStyle>
          <Style TargetType="s:CategoryDateTimeAxis">
              <Setter Property="DrawMajorGridLines" Value="{Binding ElementName=myCheckBox, Path=IsChecked, Mode=TwoWay}" />
          </Style>
      </s:SciStockChart.XAxisStyle>
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.