Reposition the TITLE and Expand the LEGEND Box on ZedGraph.

Posted on 2011-10-27
Last Modified: 2012-06-27
How to Change the position of the TITLE in ZedGraph?
How to Expand the LEGEND Box?

I'm getting data every 10 seconds.
I changed some properties and the graphic is not working.
What is wrong?
If right click on mouse and select Default Scroll or the last option in this popup menu; i see plotting but in normal view don't appear.

            //myPane02m.YAxis.Title.Text = "Particles";                     // Setta como Legenda (Particles) no Eixo Y
            myPane02m.YAxis.MajorGrid.IsVisible = true;                     // Setta Linhas no Eixo Y ou seja na Horizontal.
            myPane02m.YAxis.MajorGrid.DashOff = 5;                          // Seta a Intensidade da Linha no Eixo Y.

            // X AXIS SETTINGS
            myPane02m.XAxis.Title.IsVisible = false;                        // torna o titulo do eixo X off
            myPane02m.YAxis.Title.IsVisible = false;                        // torna o titulo do eixo Y off 
            myPane02m.XAxis.MajorGrid.DashOff = 5;                          // Seta a Intensidade da Linha no Eixo X.
            myPane02m.XAxis.MajorGrid.IsVisible = true;                     // Setta Linhas no Eixo X ou seja na Vertical.
            //myPane02m.XAxis.MajorTic.IsOpposite = false;
            //myPane02m.XAxis.MinorTic.IsAllTics = false;                   // mudei aqui para ver se para de pular o grafico.
            myPane02m.XAxis.Scale.FontSpec.Angle = 0;                       // Setta o Angulo do Scale do Eixo X.
            myPane02m.XAxis.Scale.FontSpec.Family = "Arial, Narrow";        // Setta a Fonte da Scale no Eixo X.
            myPane02m.XAxis.Scale.FontSpec.FontColor = Color.Fuchsia;       // Setta a Cor da Legenda do Dado que Entrara no Eixo X.
            myPane02m.XAxis.Scale.FontSpec.IsBold = true;                   // Setta Negrito na Scale no Eixo X.
            myPane02m.XAxis.Scale.FontSpec.Size = 26;                       // Setta o Tamanho da Fonte da Scale no Eixo X.
            myPane02m.YAxis.Scale.FontSpec.Size = 26;
            //myPane02m.XAxis.Scale.IsSkipCrossLabel = true;
            //myPane02m.XAxis.Scale.IsPreventLabelOverlap = true;
            myPane02m.XAxis.Scale.Min = 0;                                  // We want to use time from now
            myPane02m.XAxis.Scale.Max = 24;                                 // to 5 min per default
            //myPane02m.XAxis.Scale.MinorUnit = DateUnit.Second;              // set the minimum x unit to time/seconds
            //myPane02m.XAxis.Scale.MajorUnit = DateUnit.Minute;              // set the maximum x unit to time/minutes
            myPane02m.Title.Text = "2-7µm" ;
            myPane02m.Title.FontSpec.Size = 30;
            myPane02m.XAxis.Title.FontSpec.FontColor = Color.DarkViolet;    // Setta a Cor do Titulo no Eixo X.
            myPane02m.XAxis.IsVisible = true;
            myPane02m.Legend.FontSpec.Size = 27;
            myPane02m.Legend.Position = LegendPos.Float;
            myPane02m.Legend.Location = new Location(0.98, 0.0, CoordType.PaneFraction, AlignH.Right, AlignV.Top);
            myPane02m.Legend.FontSpec.Size = 19;
            myPane02m.XAxis.Scale.MinorStep = 1;                            // Setta os tracinhos da reta.
            myPane02m.XAxis.Scale.MajorStep = 1;                            // Setta o intervalo do tempo na Scale X.
            myPane02m.XAxis.Scale.MinGrace = 1;
            myPane02m.XAxis.Scale.MaxGrace = 10;
            //myPane02m.Legend.IsHStack = false;

            TickStart = Environment.TickCount;

Open in new window

Question by:ocaccy
    LVL 16

    Accepted Solution


    Author Comment

    xtermie, thank you.


    Author Comment


    I could not solve my problem with the positioning.
    I have other problems.
    How to save the images generated by Zedgraph as xxx.JPG?
    How to save the data that generated the graph as xxx.XML?
    LVL 16

    Assisted Solution


    Author Comment

    Forgive me.

    I do not know VB.

    How to transform the code to C #?
    b = Button(Text="Save Chart")
    def SaveChart():
            import clr
            from System.Windows.Forms import DialogResult, SaveFileDialog
            dialog = SaveFileDialog()
            dialog.Title = 'Save Chart as Jpg Image'
            dialog.Filter = 'Jpg Image (*.jpg)|*.JPG;|All files (*.*)|*.*'
            if dialog.ShowDialog() == DialogResult.OK:
                image.Save(dialog.FileName, ImageFormat.Jpeg)
        except Exception, e:
            print '%s: %s' % e.__class__.__name__, e
    b.Click += SaveChart
    sheet.E5 = b

    Open in new window


    Author Closing Comment

    Thank you, your links solve help me to solve my needs.
    Best Regards,

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    Article by: x-men
    Where used to see Gantt charts for illustrating project timelines, but what if I wanted to visualize passed timed events? Here's how.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now