Pre loader

Tag: TickLabelStyle

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
12k views

Hi There!

I created a UserControl that contains amongst other stuff a SciChartSurface. That control can be resized by the user to any size and is together with a lot of other stuff in a grid. The user can create a PDF of the whole whole grid using RenderTargetBitmap.

For the PDF the grid is resized by a factor x to get a higher resolution. All children of that grid are repostioned and so on and it all works. The Chart looking really good in the PDF, but the TickLabels are not resizing when changing the FontSize of their axis.

I tried to bind the FontSize in the TickLabelStyle to the Axis FontSize in XAML and tried to set the binding in code behind but I can’t get it to work.

Anyone got an idea how to set TickLabelStyle.FontSize the same as its axis FontSize?

UPDATE: Manged to set a binding in the TickLabelStyle to the upper NumericAxis, but now I have the tick labels font size changing itself between the new and old font size all the time until I it change back to the old font size.

Thanks for any help!

0 votes
4k views

On Vertical chart Label overlapping on smaller height. I have tried maxAutoTicks also and on the lower height, it’s getting one error. This error is occurring when the width is 0 sometimes. Can you please check this issues?

0 votes
3k views

Hi there,

I would like to use a column chart with labels. Our client tends to use really long names for these labels, so I was wondering if it is possible that these labels wrap. I could find no property in the docs or source that achieves this. The attached screenshot shows the current (and undesired) rendering.

The current behavior seems to be that labels in between are hidden when longer labels overlap them. Is this a configurable property? In our case, the labels may never be hidden.

Kind regards,
Tim Havinga

0 votes
9k views

Hi, guys

Please take look at:
http://prntscr.com/gmmib5

So my question is

Is there a way to highlight a line of a gridlines to which the label belong? It can be a color changed or something similar that can be easily perceived by the user.

Best regards,
Sushynski Andrei

0 votes
7k views

Is there a way to provide custom text for the labels in a PieChartSegment? I want to format the text, but haven’t been able to find a label formatter for the pie charts.

0 votes
12k views

I have a line chart and need to implement textAlign: left property for tickLabel on yAxis. I have found some way to do it on the forum, but it does not work in my case:
xAxis.setAxisTickLabelStyle(new AxisTickLabelStyle(Gravity.CENTER, Layout.Alignment.ALIGN_CENTER, 5, 0, 5, 0));
I get the error:
Alignment cannot be converted to int
But according documentation https://www.scichart.com/documentation/android/current/SciChart.Charting~com.scichart.charting.visuals.axes.AxisTickLabelStyle~_ctor.html AxisTickLabelStyle class get 5 int arguments. Can you help me please how to solve it!

1 vote
2k views

I am currently working on a chart that shows data in minutes.
As shown in the attached photo, I would like to create a tick label for every minute and bold the labels for the 5 minute ticks. Is this possible?

0 votes
0 answers
10k views

I’m using the YAxes property of the chart to data bind to a collection of NumericAxisViewModels. Is there a way to rotate the tick labels in this scenario. I can’t define a style in XAML and then assign it to the Axis because the axis is created in scichart somewhere. All I have is the axis view model. I have a LabelProvider but it doesn’t seem to support rotation unless I access the ParentAxis. Ultimately I would like to rotate some vertical axis and not other but I might be able to live with rotating all of them.

I have tried defining a style in xaml that applies to all numeric axis but it didn’t work:

<Style TargetType="{x:Type s:DefaultTickLabel}">
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <RotateTransform Angle="-90"/>
            </Setter.Value>
        </Setter>
    </Style>

Adding a LabelProvider sort of works but seems a little hacky and doesn’t set the scale appropriately ( I have to zoom to extends to see the labels). Is this the way I am supposed to do it?

public override string FormatLabel(IComparable dataValue) {
        var style = new Style(typeof(DefaultTickLabel));
        style.Setters.Add(new Setter(DefaultTickLabel.LayoutTransformProperty, new  RotateTransform(-90.0)));
        ParentAxis.TickLabelStyle = style;
1 vote
7k views

I have a DateTimeAxis.

While I can see a way to template the format the text for all the axis tick labels, I need a way to completely override what is being rendered for each item. I want, for example, today’s date to be in bold, and to apply other text/buttons below the axis label conditionally, depending on logic specific to that date.

Is this possible?

0 votes
6k views

We are using NumericAxis for the y-axis and x-axis of a bar chart. The x-axis uses a LabelProvider (to convert integers to strings) and a TickLabelStyle (to rotate the label by 270 degrees so it is vertical going from the bottom to the top). We find that sometimes the y-axis is not drawn (however, it will be drawn if the chart is resized or re-painted).

The work-around to the problem is adding spaces to the front of the shorter labels so all of the labels are all the same length. However, this work-around does not work for every case.

Have you seen this issue before and is there a better solution? Thanks!

0 votes
0 answers
13k views

I have a collection of line charts that use FastLineRenderableSeries, and they all share the same View.xaml. I’m trying to change the font size for the Y-axis tick labels in the view but for some reason it gets ignored.

This is the view for the container for all the charts:

<UserControl x:Class="….SciCharts.MainView"
…..

<ItemsControl.ItemsPanel>

</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>

</ItemsControl.ItemTemplate>

And this is the view for each individual line chart:

<UserControl x:Class="SciCharts.LineChartView"

</UserControl.Resources>


<s:SciChartSurface.XAxes>

</s:SciChartSurface.XAxes>
<s:SciChartSurface.YAxes>

</s:SciChartSurface.YAxes>

I’m able to change the color and the anchor point using the code above, but the font size is ignored completely. Tried setting it under NumericAxis but same result. Please let me know what can I do to achieve this.
Thanks,

0 votes
0 answers
10k views

Update: Please remove my previous question, I did not input the code correctly

I have a collection of line charts that use FastLineRenderableSeries, and they all share the same View.xaml. I’m trying to change the font size for the Y-axis tick labels in the view but for some reason it gets ignored.

This is the view for the container for all the charts:

<UserControl x:Class="....SciCharts.MainView"
<DockPanel >
    <Grid>
            <ItemsControl ItemsSource="{Binding ComponentCharts}" Grid.IsSharedSizeScope="True">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <UniformGrid Rows="2"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <ContentControl Content="{Binding}"/>
                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
    </Grid>
</DockPanel>

And this is the view for each individual line chart:

<UserControl x:Class="SciCharts.LineChartView"
<UserControl.Resources>
    <converters:BooleanToCollapsedVisibilityConverter x:Key="VisibilityConverter"/>
    <converters:ReverseBooleanToCollapsedConverter x:Key="ReverseVisibilityConverter"/>
    <Style x:Key="AxisLabelStyle" TargetType="s:DefaultTickLabel">
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontSize" Value="2.0"/>
        <Setter Property="HorizontalAnchorPoint" Value="Left"/>
    </Style>
</UserControl.Resources>
<DockPanel>
    <s:SciChartSurface RenderableSeries="{Binding LineChart.SeriesCollection}">
        <s:SciChartSurface.XAxes>
            <s:CategoryNumericAxis AxisTitle="Time" DrawMajorBands="False" AutoRange="Always" DrawLabels="True" />
        </s:SciChartSurface.XAxes>
        <s:SciChartSurface.YAxes>
            <s:NumericAxis DrawMajorBands="False" AxisAlignment="Left" AxisTitle="Rate" AutoTicks="True" AutoRange="Always" TickLabelStyle="{StaticResource AxisLabelStyle}"/>
        </s:SciChartSurface.YAxes>
    </s:SciChartSurface>
</DockPanel>

I’m able to change the color and the anchor point using the code above, but the font size is ignored completely. Tried setting it under NumericAxis but same result. Please let me know what can I do to achieve this.
Thanks,

Showing 12 results

Try SciChart Today

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

Start TrialCase Studies