Ternary Tick Marks

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
lilo
Newbie
Newbie
Posts: 29
Joined: Thu Sep 30, 2010 12:00 am

Ternary Tick Marks

Post by lilo » Sat Oct 09, 2010 2:37 am

Hi,

Can you check this please:

The bottom axes on the ternary plots will not display tick marks.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Ternary Tick Marks

Post by Sandra » Mon Oct 11, 2010 8:39 am

Hello lilo,

Please, check if next code works as you want:

Code: Select all

 private Steema.TeeChart.Styles.Ternary series1;
        private void InitializeChart()
        {
            series1 = new Steema.TeeChart.Styles.Ternary(tChart1.Chart);
            tChart1.Dock = DockStyle.Fill;
            tChart1.Aspect.View3D = false;
            series1.FillSampleValues();
            tChart1.Axes.Bottom.Ticks.Visible = true;
            tChart1.Axes.Bottom.Ticks.Color = Color.Red;
            tChart1.Axes.Bottom.Ticks.EndCap = System.Drawing.Drawing2D.LineCap.Round;
            tChart1.Axes.Bottom.Ticks.Width = 7;
        }
If previous code don't works for you please, explain exactly what are you want do with tick labels.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Ternary Tick Marks

Post by lilo » Tue Oct 12, 2010 4:17 pm

Thanks Sandra,

That is the code I am using...I don't have a lot of experience with teechart. Could there be issues using Teechart with vbexpress? I have a few problems formatting ternary charts.

I need to display the scale and tick marks on all of the axes, so i can have a presentable chart. I also need to be able to customize the vertex titles to my own strings. All done in code.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Ternary Tick Marks

Post by Sandra » Wed Oct 13, 2010 10:18 am

Hello lilo,

I have made next code for you using last version 4 of TeeChart.Net and VBExpress 2010:

Code: Select all

   Public Sub New()
        ' This call is required by the designer.
        InitializeComponent()
        tChart1 = New Steema.TeeChart.TChart()
        Me.Controls.Add(tChart1)
        tChart1.Dock = DockStyle.Fill
        InitializeChart()

        ' Add any initialization after the InitializeComponent() call.
    End Sub
    Private series1 As Steema.TeeChart.Styles.Ternary
    Private Sub InitializeChart()
        series1 = New Steema.TeeChart.Styles.Ternary(tChart1.Chart)

        series1.FillSampleValues()
        ' Axes Bottom
        tChart1.Axes.Bottom.Ticks.Visible = True
        tChart1.Axes.Bottom.Ticks.Color = Color.Red
        tChart1.Axes.Bottom.Ticks.EndCap = System.Drawing.Drawing2D.LineCap.Round
        tChart1.Axes.Bottom.Ticks.Width = 7
        tChart1.Axes.Bottom.SetMinMax(series1.XValues.Minimum, series1.XValues.Maximum)
        tChart1.Axes.Bottom.Increment = 20
        'Axes Left
        tChart1.Axes.Left.Ticks.Visible = True
        tChart1.Axes.Left.Ticks.Color = Color.Red
        tChart1.Axes.Left.Ticks.EndCap = System.Drawing.Drawing2D.LineCap.Round
        tChart1.Axes.Left.Ticks.Width = 7
        tChart1.Axes.Right.SetMinMax(series1.YValues.Minimum, series1.YValues.Maximum)
        tChart1.Axes.Right.Increment = 20
        'Axes Right
        tChart1.Axes.Right.Ticks.Visible = True
        tChart1.Axes.Right.Ticks.Color = Color.Red
        tChart1.Axes.Right.Ticks.EndCap = System.Drawing.Drawing2D.LineCap.Round
        tChart1.Axes.Right.Ticks.Width = 7
        tChart1.Axes.Right.SetMinMax(series1.ZValues.Minimum, series1.ZValues.Maximum)
        tChart1.Axes.Right.Increment = 20

        series1.VertexTitles(0)(0) = "Vertex A"
        series1.VertexTitles(1)(0) = "Vertex B"
        series1.VertexTitles(2)(0) = "Vertex C"
    End Sub
Could you please, tell us if previous code works for you? If don't works as you want, please say exactly where are the problems, because we can try to help you to solve your issues.

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Ternary Tick Marks

Post by lilo » Fri Oct 15, 2010 9:16 am

Still not working..I have tried all the axis and scale settings.

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Ternary Tick Marks

Post by lilo » Fri Oct 15, 2010 9:33 am

Here is a picture of the ternary plot:

12 ternary charts in the series.

Label font changed to 12 point

Border size changed to 3 pixels

Custom Vertex Labels

Tick Marks Set to True on all axes

Tick Marks only show on left and right axes

Tick Marks do not show on Bottom Axis

Label 0 on right axis vertex does not update to 12 point font
Attachments
ternarysteema2.jpg
ternarysteema2.jpg (24.02 KiB) Viewed 15374 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Ternary Tick Marks

Post by Sandra » Fri Oct 15, 2010 11:27 am

Hello lilo,
12 ternary charts in the series.
Please see the answer I put in this link

On the other hand, using next code and last version 4 of TeeChart .Net:

Code: Select all

   Steema.TeeChart.TChart tChart1;
        public Form1()
        {
            InitializeComponent();
            tChart1 = new Steema.TeeChart.TChart();
            this.Controls.Add(tChart1);
            tChart1.Dock = DockStyle.Fill;
            InitializeChart();
        }
        private void InitializeChart()
        {
       
         for (int i = 0; i < 12; i  )
        {
            new Steema.TeeChart.Styles.Ternary(tChart1.Chart);
            tChart1[i].FillSampleValues();
        }
        // Axes Bottom
        tChart1.Axes.Bottom.Ticks.Visible = true;
        tChart1.Axes.Bottom.Ticks.Color = Color.Red;
        tChart1.Axes.Bottom.Ticks.EndCap = System.Drawing.Drawing2D.LineCap.Round;
        tChart1.Axes.Bottom.Ticks.Width = 2;
        tChart1.Axes.Bottom.Labels.Font.Size = 12;
        tChart1.Axes.Bottom.AxisPen.Width = 3;
        ////Axes Left
        tChart1.Axes.Left.Ticks.Visible = true;
        tChart1.Axes.Left.Ticks.Color = Color.Red;
        tChart1.Axes.Left.Ticks.EndCap = System.Drawing.Drawing2D.LineCap.Round;
        tChart1.Axes.Left.Ticks.Width = 2;
        tChart1.Axes.Left.Labels.Font.Size = 12;
        tChart1.Axes.Left.AxisPen.Width = 3;
        ////Axes Right
        tChart1.Axes.Right.Ticks.Visible = true;
        tChart1.Axes.Right.Ticks.Color = Color.Red;
        tChart1.Axes.Right.Ticks.EndCap = System.Drawing.Drawing2D.LineCap.Round;
        tChart1.Axes.Right.Ticks.Width = 2;
        tChart1.Axes.Right.Labels.Font.Size = 12;
        tChart1.Axes.Right.AxisPen.Width = 3;
         foreach (Steema.TeeChart.Styles.Ternary series1 in tChart1.Series)
         {
              series1.VertexTitles[0][0] = "Vertex A";
              series1.VertexTitles[1][0] = "Vertex B";
              series1.VertexTitles[2][0] = "Vertex C";
         }
    }
Get below result image:
Chart1.jpg
Chart1.jpg (97.04 KiB) Viewed 15352 times
Could you please, send us a simple project or if you prefer modify my code, because we can reproduce your problem exactly here?
Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Ternary Tick Marks

Post by lilo » Fri Oct 15, 2010 12:38 pm

Thanks for your reply,

Here is the result using your code...see picture. Also the bottom tick marks continue not to plot.
TChart1.Series.Chart.Axes.Left.Ticks.Visible = True
TChart1.Series.Chart.Axes.Right.Ticks.Visible = True
TChart1.Series.Chart.Axes.Bottom.Ticks.Visible = True

TChart1.Series.Chart.Axes.Left.Ticks.Length = 7
TChart1.Series.Chart.Axes.Right.Ticks.Length = 7
TChart1.Series.Chart.Axes.Bottom.Ticks.Length = 7

TChart1.Series.Chart.Axes.Left.Ticks.Width = 2
TChart1.Series.Chart.Axes.Right.Ticks.Width = 2
TChart1.Series.Chart.Axes.Bottom.Ticks.Width = 2
TChart1.Series.Chart.Axes.Bottom.Ticks.Color = Drawing.Color.Red
TChart1.Series.Chart.Axes.Left.Ticks.Color = Drawing.Color.Red
TChart1.Series.Chart.Axes.Right.Ticks.Color = Drawing.Color.Red


If i set the pointer = series.Pointer.Brush.Transparency = 0 the line pointers will not plot...star, cross, diagonal cross
Using
AddHandler Ternary1.GetPointerStyle, New Steema.TeeChart.Styles.Ternary.GetPointerStyleEventHandler(AddressOf Ternary1_GetPointerStyle)

Sub Ternary1_GetPointerStyle(ByVal series As Object, ByVal e As Steema.TeeChart.Styles.GetPointerStyleEventArgs)
If e.ValueIndex > NumSamples Then Exit Sub
e.Color = SampleColor(e.ValueIndex)
If PointerofSample(e.ValueIndex) = 34 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Circle
If PointerofSample(e.ValueIndex) = 35 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Triangle
If PointerofSample(e.ValueIndex) = 36 Then e.Style = Steema.TeeChart.Styles.PointerStyles.DownTriangle
If PointerofSample(e.ValueIndex) = 37 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Cross
If PointerofSample(e.ValueIndex) = 38 Then e.Style = Steema.TeeChart.Styles.PointerStyles.DiagCross
If PointerofSample(e.ValueIndex) = 39 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Star
If PointerofSample(e.ValueIndex) = 40 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Diamond
If PointerofSample(e.ValueIndex) = 41 Then e.Style = Steema.TeeChart.Styles.PointerStyles.SmallDot
If PointerofSample(e.ValueIndex) = 42 Then e.Style = Steema.TeeChart.Styles.PointerStyles.LeftTriangle
If PointerofSample(e.ValueIndex) = 43 Then e.Style = Steema.TeeChart.Styles.PointerStyles.RightTriangle
If PointerofSample(e.ValueIndex) = 44 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Sphere
If PointerofSample(e.ValueIndex) = 45 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Hexagon
If PointerofSample(e.ValueIndex) = 46 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Nothing
End Sub
ternary3.jpg
ternary3.jpg (22.3 KiB) Viewed 15348 times
If i set the pointer = series.Pointer.Brush.Transparency = 100, none of the pointers will plot correctly...the inner part of the spheres will plot
ternary4.jpg
ternary4.jpg (20.22 KiB) Viewed 15347 times
This is how they should plot with series.Pointer.Brush.Transparency = 0

and using 12 ternary series

For i = 1 To NumofSamples
Call GetPointer(i)
If PointerofSample(i) = 33 Then Ternary1.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 34 Then Ternary2.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 35 Then Ternary3.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 36 Then Ternary4.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 37 Then Ternary5.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 38 Then Ternary6.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 39 Then Ternary7.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 40 Then Ternary8.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 41 Then Ternary9.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 42 Then Ternary10.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 43 Then Ternary11.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 44 Then Ternary12.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 45 Then Ternary13.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
If PointerofSample(i) = 46 Then Ternary14.Add(Min1A(i), Min3A(i), Min2A(i), Color3(i))
Next i

'Pointer Styles
Ternary1.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle
Ternary2.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Circle
Ternary3.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Triangle
Ternary4.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.DownTriangle
Ternary5.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Cross
Ternary6.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.DiagCross
Ternary7.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Star
Ternary8.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Diamond
Ternary9.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.SmallDot
Ternary10.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.LeftTriangle
Ternary11.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.RightTriangle
Ternary12.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Sphere
Ternary13.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Hexagon
Ternary14.Pointer.Style = Steema.TeeChart.Styles.PointerStyles.Nothing
ternarysteema2.jpg
ternarysteema2.jpg (24.02 KiB) Viewed 15350 times

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Ternary Tick Marks

Post by lilo » Fri Oct 15, 2010 12:42 pm

and this how they should plot with
series.Pointer.Brush.Transparency = 100

When will the bug fix be released for the ternary series overprinting problem (blurry chart)?

ternary5.jpg
ternary5.jpg (22.21 KiB) Viewed 15403 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Ternary Tick Marks

Post by Sandra » Fri Oct 15, 2010 2:47 pm

Hello lilo,
Here is the result using your code...see picture. Also the bottom tick marks continue not to plot.
TChart1.Series.Chart.Axes.Left.Ticks.Visible = True
TChart1.Series.Chart.Axes.Right.Ticks.Visible = True
TChart1.Series.Chart.Axes.Bottom.Ticks.Visible = True

TChart1.Series.Chart.Axes.Left.Ticks.Length = 7
TChart1.Series.Chart.Axes.Right.Ticks.Length = 7
TChart1.Series.Chart.Axes.Bottom.Ticks.Length = 7

TChart1.Series.Chart.Axes.Left.Ticks.Width = 2
TChart1.Series.Chart.Axes.Right.Ticks.Width = 2
TChart1.Series.Chart.Axes.Bottom.Ticks.Width = 2
TChart1.Series.Chart.Axes.Bottom.Ticks.Color = Drawing.Color.Red
TChart1.Series.Chart.Axes.Left.Ticks.Color = Drawing.Color.Red
TChart1.Series.Chart.Axes.Right.Ticks.Color = Drawing.Color.Red
Thanks for your code. Finally I have understood what was the problem. I have added your request in the bug list with number [TF02015221], we will try to fix it for next maintenance releases.

On the other hand,Using next code and last version 4 transparency property works fine for me:

Code: Select all

 Steema.TeeChart.TChart tChart1;
        public Form1()
        {
            InitializeComponent();
            tChart1 = new Steema.TeeChart.TChart();
            this.Controls.Add(tChart1);
            tChart1.Dock = DockStyle.Fill;
            InitializeChart();
        }
        private void InitializeChart()
        {
            for (int i = 0; i < 12; i  )
            {
                new Steema.TeeChart.Styles.Ternary(tChart1.Chart);
                tChart1[i].FillSampleValues();
                (tChart1[i] as Steema.TeeChart.Styles.Ternary).Pointer.Visible = true;
                (tChart1[i] as Steema.TeeChart.Styles.Ternary).Pointer.Brush.Transparency = 0;
            }
        }
Could you please, tell us if using previous code transparency property works for you? if in previous example doesn't appear your problem, please modify it, because we can reproduce it here.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Ternary Tick Marks

Post by lilo » Sun Oct 17, 2010 11:03 am

Could you please, tell us if using previous code transparency property works for you? if in previous example doesn't appear your problem, please modify it, because we can reproduce it here.
Does not work if I plot 24 samples, 2 samples each pointer style. If I plot 12 samples, 1 sample each pointer style, works fine.

If I plot more than 1 sample each pointer style, does not work.

Ternary1.Pointer.HorizSize = 20 'SizeinPixels
Ternary1.Pointer.VertSize = 20
Ternary1.Pointer.Visible = True
Ternary1.Pointer.Brush.Transparency = 0
Dim i as integer
For i 1 to numberofsamples
Ternary1.Add(XVal(i), YVal(i), ZVal(i), PointerColor(i))
Next i

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Ternary Tick Marks

Post by lilo » Sun Oct 17, 2010 11:33 am

Most of the time its the simple things :wink:

OK, problem is fixed if i remove the e.Style = Steema.TeeChart.Styles.PointerStyles.Sphere

If PointerofSample(e.ValueIndex) = 34 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Circle
If PointerofSample(e.ValueIndex) = 35 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Triangle
If PointerofSample(e.ValueIndex) = 36 Then e.Style = Steema.TeeChart.Styles.PointerStyles.DownTriangle
If PointerofSample(e.ValueIndex) = 37 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Cross
If PointerofSample(e.ValueIndex) = 38 Then e.Style = Steema.TeeChart.Styles.PointerStyles.DiagCross
If PointerofSample(e.ValueIndex) = 39 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Star
If PointerofSample(e.ValueIndex) = 40 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Diamond
If PointerofSample(e.ValueIndex) = 41 Then e.Style = Steema.TeeChart.Styles.PointerStyles.LeftTriangle
If PointerofSample(e.ValueIndex) = 42 Then e.Style = Steema.TeeChart.Styles.PointerStyles.RightTriangle
'If PointerofSample(e.ValueIndex) = 43 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Sphere '-remove this line
If PointerofSample(e.ValueIndex) = 44 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Hexagon
If PointerofSample(e.ValueIndex) = 46 Then e.Style = Steema.TeeChart.Styles.PointerStyles.Nothing

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Ternary Tick Marks

Post by Sandra » Mon Oct 18, 2010 8:35 am

Hello lilo,

Thanks you for your code. I am glad that you have found the problem :).
On the other hand, I could reproduce your problem when I have added style pointer sphere and I have added your request in bug list with number [TF02015223]. We will try to fix it in next maintenance releases of TeeChart .Net.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply