ViewXY - Axis.Title Z order

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

ViewXY - Axis.Title Z order

Post by ahe » Wed Nov 25, 2015 3:48 pm

The axis' labels Title and Units seem to be placed behind the axis:
AxisTitleClipping.png
AxisTitleClipping.png (3.02 KiB) Viewed 22594 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...)

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: ViewXY - Axis.Title Z order

Post by ArctionPasi » Wed Nov 25, 2015 4:08 pm

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.
LightningChart Support Team, PT

ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

Re: ViewXY - Axis.Title Z order

Post by ahe » Thu Nov 26, 2015 10:42 am

Annotations seem to be rendered behind the axis aswell:
AxisTitleClipping_Annotation.png
AxisTitleClipping_Annotation.png (37.56 KiB) Viewed 22588 times
Am I missing a property? Or did I misunderstand you?
Attachments
Form1.zip
(1.25 KiB) Downloaded 614 times

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: ViewXY - Axis.Title Z order

Post by ArctionPasi » Fri Nov 27, 2015 10:10 pm

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 22580 times
LightningChart Support Team, PT

ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

Re: ViewXY - Axis.Title Z order

Post by ahe » Wed Dec 02, 2015 8:36 am

Thanks, this works.

ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

Re: ViewXY - Axis.Title Z order

Post by ahe » Mon Feb 22, 2016 3:42 pm

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 22136 times

Code: Select all

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

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: ViewXY - Axis.Title Z order

Post by ArctionPasi » Wed Feb 24, 2016 5:33 pm

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
LightningChart Support Team, PT

ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

Re: ViewXY - Axis.Title Z order

Post by ahe » Thu Feb 25, 2016 8:10 am

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.

Post Reply