Page 1 of 1

ViewXY - Axis.Title Z order

Posted: Wed Nov 25, 2015 3:48 pm
by ahe
The axis' labels Title and Units seem to be placed behind the axis:
AxisTitleClipping.png
AxisTitleClipping.png (3.02 KiB) Viewed 22690 times

Code: Select all

axis.Units.Text = "[Units]";
axis.Units.Fill.Color = Color.Red; // Red for demonstration, White for production
axis.Units.Fill.GradientColor = Color.Red;
axis.Units.Fill.GradientFill = GradientFill.Solid;
axis.Units.Fill.Style = RectFillStyle.ColorOnly;
axis.Units.DistanceToAxis = 7;
axis.Units.HorizontalAlign = XAxisTitleAlignmentHorizontal.Center;
axis.Units.VerticalAlign = XAxisTitleAlignmentVertical.Bottom;
Is there a way to influence the Z order of the Title/Units so that the Text can override the axis scale numbers?

(The old library did it this way, LightningCharts as the replacement is expected to behave the same, according to my boss...)

Re: ViewXY - Axis.Title Z order

Posted: Wed Nov 25, 2015 4:08 pm
by ArctionPasi
LightningChart renders the axis labels, titles and units in a batch for performance reasons. That means, first the fills are rendered, then the texts.

Please use Annotations to show the texts with a fill, retaining the fill / text order you prefer.

Re: ViewXY - Axis.Title Z order

Posted: Thu Nov 26, 2015 10:42 am
by ahe
Annotations seem to be rendered behind the axis aswell:
AxisTitleClipping_Annotation.png
AxisTitleClipping_Annotation.png (37.56 KiB) Viewed 22684 times
Am I missing a property? Or did I misunderstand you?

Re: ViewXY - Axis.Title Z order

Posted: Fri Nov 27, 2015 10:10 pm
by ArctionPasi
Sorry I gave wrong info about annotations. They really seem be rendered behind the axes.

Series titles are rendered after the axes, so that would be they way to render text over axis value labels.

Code: Select all




  pls.Title.Visible = true;
            pls.Title.MouseInteraction = false;
            pls.Title.Fill.Color = Color.Red;
            pls.Title.Fill.GradientColor = Color.Red;
            pls.Title.Fill.Style = RectFillStyle.ColorOnly; 
            pls.Title.Text = "My units text";
            pls.Title.Color = Color.Yellow;
            pls.Title.LimitInsideGraphMargins = false;
            pls.Title.LockAutoPosition = false;
            pls.Title.AutoPlacement = false;
            pls.Title.HorizontalAlign = AlignmentHorizontal.Center;
            pls.Title.VerticalAlign = AlignmentVertical.Bottom;
            pls.Title.Offset.Y = 40; 
Here, pls is a series. You may want to use a dummy series, not an actual series containing data.

Then it becomes like this:
Series title over the axis
Series title over the axis
axis.jpg (9.16 KiB) Viewed 22676 times

Re: ViewXY - Axis.Title Z order

Posted: Wed Dec 02, 2015 8:36 am
by ahe
Thanks, this works.

Re: ViewXY - Axis.Title Z order

Posted: Mon Feb 22, 2016 3:42 pm
by ahe
I found another issue. It seems the title text of the PointLineSeries is trimmed on the right side:
Bug_SeriesTitle.png
Bug_SeriesTitle.png (5.65 KiB) Viewed 22232 times

Code: Select all

PointLineSeries _unit;
_unit.Title.Text = "    [" + strAxisUnit + "]    ";
Tested in 6.5.6 and 6.5.7

Re: ViewXY - Axis.Title Z order

Posted: Wed Feb 24, 2016 5:33 pm
by ArctionPasi
The DirectX text measuring methods don't measure the trailing spaces.
DirectX-side code: rectText = dxFont.MeasureText(m_spriteText, text, FontDrawFlags.NoClip);

The rectangle size of the title is based on this this info.

I'm sorry it seems we can't fix it.



How about adding a white border around the title?

series.Title.Border.Style = Outer
series.Ttile.Border.Color1 = White
series.Title.Border.Color2 = White
series.Title.Border.Width = 3

Re: ViewXY - Axis.Title Z order

Posted: Thu Feb 25, 2016 8:10 am
by ahe
Hmmm, this will only work for small borders as it will otherwise overwrite the axis and the ticks to the top and not just the numbers.

But I'll accept it as a workaround.