Pre loader

Tag: AxisLabelTemplate

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

1 vote
5k views

Hey, how would I go about adding a custom template for the cursor axis labels using the Javascript 2D chart API?

I’d like the x-axis to not just have a date in MM/DD/YYYY format but a date and time displayed. The current implementation is below, and below that is the desired implementation.

Current: https://ibb.co/qJgJ36j

Desired: https://ibb.co/XzTkDgw

I have looked through the documentation but I may have missed something. If I have, please point me in the right direction, thanks!

1 vote
18k views

Hi

I want to override the default AxisLabelTemplate for a DateTimeAxis beyond the normal circumstances.
Setting the AxisLabelTemplate to a StaticResource is easy enough, but all I have inside the Template is the CursorFormattedDataValue and I want to be able to send in something more then a simple string.

<ControlTemplate x:Key="RolloverModifierAxisLabelTemplateDefault">
    <Border Background="LightGray" 
            Opacity="0.80" 
            BorderThickness="0"
            CornerRadius="5"
            Padding="2"
            Visibility="{Binding IsXAxis, Converter={StaticResource BoolToVisibilityConverter}}">
        <TextBlock Text="{Binding CursorFormattedDataValue}" />
    </Border>
</ControlTemplate>

Extending the LabelProviderBase gives me the opportunity to override the FormatCursorLabel method, but it only returns a string and not an object and therefore I can not pass my own data structure to be used inside the AxisLabelTemplate.

How can we solve this issue? Is there a workaround, or is this something you need to implement?

0 votes
7k views

Is it possible to set different color to axis ticks and axis title.
In 2D-Chart i did it by changing the style of DefaultTickLabel:

<Style x:Key="NumericAxisForMvvm" TargetType="axis:NumericAxisForMvvm">

  <Setter Property="FontSize" Value="12" />
  <Setter Property="FontFamily" Value="Arial" />
  <Setter Property="FontWeight" Value="Bold" />
  <Setter Property="TickTextBrush" Value="Red" />

  <Setter Property="TickLabelStyle">
    <Setter.Value>
      <Style TargetType="s:DefaultTickLabel">

        <Setter Property="FontSize" Value="16" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontFamily" Value="Courier New" />
        <Setter Property="Foreground" Value="Blue" />

        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="s:DefaultTickLabel">
              <ContentControl Content="{Binding}"
                              ContentTemplate="{TemplateBinding ContentTemplate}"
                              IsTabStop="False" 
                              Foreground="{TemplateBinding Foreground}" 
                              FontFamily="{TemplateBinding FontFamily}"
                              FontSize="{TemplateBinding FontSize}"
                              FontWeight="{TemplateBinding FontWeight}"/>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
    </Setter.Value>
  </Setter>
</Style>

Same procedure seems doesn’t work for 3D-Charts.
How can i achieve this?
Is that currently possible?

Best Regards
Silvester

0 votes
6k views

Dear sir,

I’m trying SciChartSurface.
I wanna have a Chart updating per minute,
X-Axis means time, Y-Axis means products,
and every product has a multi-color bar which I can build it in the viewmodel.
Every product’s name should be the position between two lines.
Can SciChart do that…? Cause I’m using surface with numericAxis, but the product name is always next to the line, not between two lines.

  • Wade Yao asked 3 years ago
  • last active 3 years ago
0 votes
5k views

Is there any way to provide custom axis label for cursor modifier or at least change label size? I could find only axis label stroke & fill properties in cursor modifier API.

0 votes
12k views

Hi,

I have a chart where the Axis Title is truncated because the title is too long. Is there a way to wrap or put an ellipsis in the Axis Title? The height of my chart should be fix, so I have to do something about the title instead.

Thanks,
Ira

Showing 6 results

Try SciChart Today

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

Start TrialCase Studies