This project is read-only.

Is it possible to show the axis unit in specific culture?

Aug 17, 2009 at 9:33 PM
Edited Aug 17, 2009 at 9:51 PM

Is it possible to show the axis unit in a specific culture on-the-fly?

for an example, in English, x-axis may show scale unit as "1,000 2,000 3,000 4,000" (digit group symbol is ',')

in German, x-scale may show scale unit as "1.000 2.000 3.000 4.000" (digit group symbol is '.')

We notice that x-axis scale unit may show correct unit when graph still keep update itself (real time plot)

However, if the plot is finish update, then change the culture will not update axis scale unit, how to fix it? 

thx!

 

Aug 24, 2009 at 4:55 PM

Hi, Jane,

Yes, it is possible to show axis labels in the culture you prefer more)

The following code does this:

axis.LabelProvider.SetCustomFormatter(info=>
return info.Tick.ToString(new CultureInfo("de-De")));

Hope this will help.
Best regards,
Mikhail.

 

Aug 24, 2009 at 5:16 PM

Hi Mikhail,

Thanks for your info. We are waiting for this solution.

Where we can get "axis" object? Through "this" or "Plotter" we did not found this object.

thanks,

Jane

 

Aug 24, 2009 at 5:19 PM
Edited Aug 24, 2009 at 5:20 PM

Jane,

You can get at the axis by using Plotter.MainVerticalAxis (if you are using a Plot with one Vertical and one Horizontal axis) or if you have more than one, you can loop through the children until you find it...

Something like:

for (int i = 0; i < plotter.Children.Count; i++)
{
        if (plotter.Children[i] is VerticalAxis)
        {
              ........
        }

}

Aug 24, 2009 at 5:43 PM

Thank you, quinlivan, for you right explanations!

Jane, please, take a look into AxisColoringSample in, for example, latest changset of DynamicDataDisplay at 'Source code' page. You can find this sample in Changeset/Nightly/sln/DynamicDataDisplay.sln/Samples/v0.3.1/AxisColoringSample.csproj. Maybe it will give you more info about axes customization in DynamicDataDisplay.

Best regards,

Mikhail.