|
|
Comments and Discussions
|
|
 |

|
Can I use it in a C++ project? The control does not show up in the toolbox for the c++ project (on the other hand can see it in a VB project)
?
|
|
|
|
|
|

|
I've been using the MSChart control to draw some simple line graphs, but decided that I'd like to give ZedGraph a try.
This tutorial is outstandingly useful. (Not to mention ZedGraph itself.)
Thank You very much for all your work. Much appreciated.
|
|
|
|

|
Excellent, clear and easy code!
Just amazing!
|
|
|
|

|
Thank you very much for this amazing tool... light and has wide-range of functionality... Keep developing it, really amazing work...
Thank you again... Best Regrads
|
|
|
|

|
Nice & helpful article. Thank's
|
|
|
|

|
I've been using your control in a motor performance display application for over a year now and am very greatful for your contribution. Thank you!
|
|
|
|

|
Excellent library and wonderful explaination with clarity and examples that help a lot.
Thank you so much,
Kalpana Volety
PDF tools online
|
|
|
|

|
First of all thank you for a great library of charting tools. For years I have been charting Access data in Excel, transferred via VB.Net, as all the versions change this has become one big PAIN. Now with ZedGraph I'm charting directly from the Access database.
I have a simple 3 curve graph (3 Y values on the same X) but I get a complete duplicate in the legend, instead of 3 items I'm getting 6, tried the label as "" but then I miss that item in the legend entirely.
Once again, thank you.
John
|
|
|
|

|
As you have mentioned that :"the units of XAxis.Scale.MajorStep and XAxis.Scale.MinorStep will depend on the setting of XAxis.Scale.MajorUnit and XAxis.Scale.MinorUnit, respectively" but i haven't found your explaination about this ! i hope you can give me example about this !
|
|
|
|

|
In my polar I have three concentric circles which form two rings. The rings are divided on several sectors.
The question is how can I fill these sectors in different colors ?
|
|
|
|

|
Hi,
Let's assume that I have two curves at the same pane and I want to fill each curve only the part above a given value, e.g., it's own average. How can I do it? Can I do that without extra curves?
Thanks
|
|
|
|
|

|
Saya berhasil menggunakannya & menggabungkannya dengan DatTable di vB.net.
Thanks
|
|
|
|

|
My Desktop: W7, VS2010, C# and ZedGraph.
In the my Desktop App, has a numericUpDown ranging from 1 to 3300.
Each 1 of the numericUpDown is equal 1 second.
On ZedGraph, how to put this numericUpDown in Xaxis in format 00:00~55:00, with an interval of 5 minutes in Pane.XAxis.MajorStep and 1 minute in Pane.XAxis.MajorStep?
Thanks in advance, pontes
|
|
|
|

|
Great library with a clear and useful VB.NET example.
|
|
|
|

|
Is there a way to highlight points on a line graph (Y-Values) that exceed a certain value? I can change the point symbol and the size, but this is applied to all points on the line graph.
I would like to add a visual highlight to values that exceed a 'happy' value.
Thanks
|
|
|
|

|
Hi
I am trying to use the date class to draw a graph in c++/cli
what I have is a pre-existing matrix globally defined as private: array^ moist_matx;
when I tried to do
XDate dato(moist_matx[i,0],moist_matx[i,1],moist_matx[i,2]); //date
double x = (double)dato;
I would get the I can't to convert from Int32 to int
I then tried to use the XDate dato instead of my matrix but it just gives me one point on the graph as I am not doing the i index in the dayI am doing
XDate dato (year,month,day) and I am inputing the year,month and day I have.
Please tell me how I can fix it.
Thanks
Eman
|
|
|
|

|
I use scatter plot in Zedgraph and trying to add a trend line over it. Now, I have two questions: 1. How should I make sure that the textobj containing the equation and R2 of trendline is always on the upper left corner of the graph inside the graph box? I tried to fix it using the max and min of graph scale but so far I am unsuccessful. 2. How can I remove the textobj from the graph?
|
|
|
|

|
Excellent easy-to-apply project for .NET-ers. Realy well done!
|
|
|
|

|
I used it in my project and it was superb and very easy to implement!
|
|
|
|

|
My graph range is between -5 to 2.
So i want to hide Y=0 line from my graph, How to do tihs.
Pls help.
Sample
2 | *
1 | *
_0 |________________*____________________________ <== i want to hide this line
-1 | *
-2 | *
|
|
|
|

|
Its easy and great completeness
|
|
|
|

|
how to include multiple legends for a graph
|
|
|
|

|
Hello Everyone,
Is there anyway to make axis labels editable by users? Just like excel, when you click on the label, it turns to textbox and you can modify the labels. Thanks, Amir
|
|
|
|

|
maybe can use this property
zgAverage.GraphPane.XAxis.Title.Text = "Sample"
zgAverage.GraphPane.YAxis.Title.Text = "Sample"
zgAverage.AxisChange()
|
|
|
|
|

|
ZedGraphControl1.GraphPane.CurveList.Clear()
ZedGraphControl1.Invalidate()
|
|
|
|

|
//Assuming you are using
BarItem.CreateBarLabels(myPane,true,"f0");
// replace all "0" labels with an empty string
int labelItems = myPane.GraphObjList.Count();
for( int t = 0 ; t < labelItems; t++ ){
TextObj to = (TextObj)myPane.GraphObjList[t];
if(string.Compare(to.Text,"0") == 0 )
to.Text = "";
}
|
|
|
|

|
I want to plot serialport data onto my zedgraph as well as display in a label the current value of serial data. i can display the serial data in my label but cannot plot the graph. Can anyone please help me plot the serialdata on ZedGraph in vb6.
I am communicating with my computer via a serial port.I want to plot serial port data on to ZedGraph and also display it in a label. I can only display serial data in my label but failed to plot the graph.Can someone help me?
Imports ZedGraph
Imports System.IO.Ports
Imports System.Threading
Public Class Form1
Public data As Double
Public p As Double
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.CenterToScreen()
CreateGraphlabels(ZedGraphControl1) ' set the graph title and x and y axis titles
End Sub
Private Sub CreateGraphlabels(ByVal zgc As ZedGraphControl)
Dim myPane As GraphPane = zgc.GraphPane
myPane.Title.Text = "Neonatal Resuscitation "
myPane.XAxis.Title.Text = "Time"
myPane.YAxis.Title.Text = "Pressure"
End Sub
Private Sub cmd_open_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_open.Click
Try
If SerialPort1.IsOpen = False Then
SerialPort1.Open()
Console.WriteLine("PORT OPEN SUCCEEDED.")
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
data = SerialPort1.ReadByte ' read serialport data
Me.Invoke(New EventHandler(AddressOf UpdateControls_label)) ' invoke event to display serial data in label
End Sub
Public Sub UpdateControls(ByVal sender As Object, ByVal e As EventArgs)
Me.lbldataplotdisp.Text = data ' displays serial port data in the label
CreateGraphic(ZedGraphControl1)
End Sub
Private Sub CreateGraphic(ByVal zgc As ZedGraphControl)
Dim myPane As GraphPane = zgc.GraphPane
Dim list = New PointPairList()
Dim x As Double, y As Double
y = data
list.Add(x, y)
x = x + 1.0
Dim myCurve As LineItem =myPane.AddCurve("MyCurve",list,Color.Blue,SymbolType.Circle)
zgc.AxisChange()
End Sub
End Class
|
|
|
|
|

|
Bar types
when do the Bar types example.I found that when the new data bind but the old data also exist so mypane.addbar() wrong ,it means when the first data bind the control is right but then we second bind new date it's wrong ,also as the third time ,fouth time.
I found the solve method:
we should do
myPane.CurveList.Clear()
before the code
myBar = myPane.AddBar("label", Nothing, y, Color.Black)
that's ok
pls,contract me http://hi.baidu.com/zhangcheng1
this is Gordon from China
pls,visit my borker: http://hi.baidu.com/zhangcheng1
|
|
|
|
|

|
I want to create a simple bar graph where the bars are SOLID, but the color of each bar is based on the gradient selection. I can get this somewhat working but... ie. the bars have the correct color, but each bar has a horizontal gradient of the color and white.
How do I force the fill to be SOLID but have the ability to change each bars color based on the selected color or GradientByZ value etc.
Argh!
|
|
|
|

|
I found this on another thread.
Use fill.SecondaryValueGradientColor = color.empty
The bars will be filled SOLID.
|
|
|
|
|

|
Hi there,
I love this library, I am just wondering is there any way to change the alignment of labels (For example 30,45 or 60... degree)?
Thank you in advance for your time
|
|
|
|
|

|
Visual basic 2010. This code uses 500 MEG of memory!! Is that normal for VB.NET?
Imports ZedGraph
Public Class frmMain
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myPane As GraphPane = zg1.GraphPane
' Set the titles and axis labels
myPane.Title.Text = "Demonstration of Dual Y Graph"
myPane.XAxis.Title.Text = "Time, Days"
myPane.YAxis.Title.Text = "Parameter A"
myPane.Y2Axis.Title.Text = "Parameter B"
' Make up some data points based on the Sine function
Dim list As New PointPairList
Dim list2 As New PointPairList
Dim i As Integer, x As Double, y As Double, y2 As Double
For i = 0 To 35 Step 0.5
x = i * 5.0
y = Math.Sin(i * Math.PI / 15.0) * 16.0
y2 = y * 13.5
list.Add(x, y)
list2.Add(x, y2)
Next i
' Generate a red curve with diamond symbols, and "Alpha" in the legend
Dim myCurve As LineItem
myCurve = myPane.AddCurve("Alpha", list, Color.Red, SymbolType.Diamond)
' Fill the symbols with white
myCurve.Symbol.Fill = New Fill(Color.White)
' Generate a blue curve with circle symbols, and "Beta" in the legend
myCurve = myPane.AddCurve("Beta", list2, Color.Blue, SymbolType.Circle)
' Fill the symbols with white
myCurve.Symbol.Fill = New Fill(Color.White)
' Associate this curve with the Y2 axis
myCurve.IsY2Axis = True
' Show the x axis grid
myPane.XAxis.MajorGrid.IsVisible = True
' Make the Y axis scale red
myPane.YAxis.Scale.FontSpec.FontColor = Color.Red
myPane.YAxis.Title.FontSpec.FontColor = Color.Red
' turn off the opposite tics so the Y tics don't show up on the Y2 axis
myPane.YAxis.MajorTic.IsOpposite = False
myPane.YAxis.MinorTic.IsOpposite = False
' Don't display the Y zero line
myPane.YAxis.MajorGrid.IsZeroLine = False
' Align the Y axis labels so they are flush to the axis
myPane.YAxis.Scale.Align = AlignP.Inside
' Manually set the axis range
myPane.YAxis.Scale.Min = -30
myPane.YAxis.Scale.Max = 30
' Enable the Y2 axis display
myPane.Y2Axis.IsVisible = True
' Make the Y2 axis scale blue
myPane.Y2Axis.Scale.FontSpec.FontColor = Color.Blue
myPane.Y2Axis.Title.FontSpec.FontColor = Color.Blue
' turn off the opposite tics so the Y2 tics don't show up on the Y axis
myPane.Y2Axis.MajorTic.IsOpposite = False
myPane.Y2Axis.MinorTic.IsOpposite = False
' Display the Y2 axis grid lines
myPane.Y2Axis.MajorGrid.IsVisible = True
' Align the Y2 axis labels so they are flush to the axis
myPane.Y2Axis.Scale.Align = AlignP.Inside
' Fill the axis background with a gradient
myPane.Chart.Fill = New Fill(Color.White, Color.LightGray, 45.0F)
' Add a text box with instructions
Dim text As New TextObj( _
"Zoom: left mouse & drag" & Chr(10) & "Pan: middle mouse & drag" & Chr(10) & "Context Menu: right mouse", _
0.05F, 0.95F, CoordType.ChartFraction, AlignH.Left, AlignV.Bottom)
text.FontSpec.StringAlignment = StringAlignment.Near
myPane.GraphObjList.Add(text)
' Enable scrollbars if needed
zg1.IsShowHScrollBar = True
zg1.IsShowVScrollBar = True
zg1.IsAutoScrollRange = True
zg1.IsScrollY2 = True
zg1.IsShowPointValues = True
' Size the control to fit the window
SetSize()
' Tell ZedGraph to calculate the axis ranges
' Note that you MUST call this after enabling IsAutoScrollRange, since AxisChange() sets
' up the proper scrolling parameters
zg1.AxisChange()
' Make sure the Graph gets redrawn
zg1.Invalidate()
End Sub
' On resize action, resize the ZedGraphControl to fill most of the Form, with a small
' margin around the outside
Private Sub frmMain_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
SetSize()
End Sub
Private Sub SetSize()
Dim loc As New Point(10, 10)
zg1.Location = loc
' Leave a small margin around the outside of the control
Dim size As New Size(Me.ClientRectangle.Width - 20, Me.ClientRectangle.Height - 20)
zg1.Size = size
End Sub
'Display customized tooltips when the mouse hovers over a point
Private Function MyPointValueEvent(ByVal control As ZedGraphControl, _
ByVal pane As GraphPane, ByVal curve As CurveItem, _
ByVal iPt As Integer) As String Handles zg1.PointValueEvent
' Get the PointPair that is under the mouse
Dim pt As PointPair = curve(iPt)
Return curve.Label.Text + " is " + pt.Y.ToString("f2") + " units at " + pt.X.ToString("f1") + " days"
End Function
' Customize the context menu by adding a new item to the end of the menu
Private Sub MyContextMenuBuilder(ByVal control As ZedGraphControl, _
ByVal menu As ContextMenuStrip, ByVal mousePt As Point, _
ByVal objState As ZedGraphControl.ContextMenuObjectState) _
Handles zg1.ContextMenuBuilder
Dim item As New ToolStripMenuItem
item.Name = "add-beta"
item.Tag = "add-beta"
item.Text = "Add a new Beta Point"
AddHandler item.Click, AddressOf Me.AddBetaPoint
menu.Items.Add(item)
End Sub
' Handle the "Add New Beta Point" context menu item. This finds the curve with
' the CurveItem.Label = "Beta", and adds a new point to it.
Private Sub AddBetaPoint(ByVal sender As Object, ByVal args As EventArgs)
' Get a reference to the "Beta" curve PointPairList
Dim x As Double, y As Double
Dim ip As IPointListEdit = zg1.GraphPane.CurveList("Beta").Points
If (Not IsNothing(ip)) Then
x = ip.Count * 5.0
y = Math.Sin(ip.Count * Math.PI / 15.0) * 16.0 * 13.5
ip.Add(x, y)
zg1.AxisChange()
zg1.Refresh()
End If
End Sub
Private Sub zg1_ZoomEvent(ByVal control As ZedGraphControl, ByVal oldState As ZoomState, _
ByVal newState As ZoomState) Handles zg1.ZoomEvent
'Here we get notification everytime the user zooms
End Sub
End Class
|
|
|
|

|
Hello all!
I am building an application where I need to plot data in real time not using date on the Xaxis though. This means I wanna plot the last seconds being these represented as negative values (past time).
For better understanding, what i wanna do is plotting data from right to left, like this:
http://www.mediafire.com/i/?fdgume0h9f8zb0a
although i dont want the xaxis plotting the interval [0,60] but [-60, 0] like this:
http://www.mediafire.com/i/?s675ln6z87si686
My problem is: in order to write negative values on the xaxis I have to define the AxisType as Text, but doing so the Xaxis becomes ordinal and the information each point contains correspondng to the Xaxis is ignored (as specified on the Text property). Therefore the points are plotted from left to right as it is possible to see on the previous image.
Text property:
"An ordinal axis with user-defined text labels. An ordinal axis means that all data points are evenly spaced at integral values, and the actual coordinate values for points corresponding to that axis are ignored. That is, if the X axis is an ordinal type, then all X values associated with the curves are ignored."
I have tried several different approches but none of them was successful. On one hand I can only write negative values on the Xaxis using the text property, on the other hand the axis becomes ordinal and I the points are ploted from left to right contrarily to what I want. -> dead end...
Anyone had the same problem or has any idea/suggestion how to step through it?
Thanks in advance!
|
|
|
|

|
I'm using it to simulate a scope trace. Very plain jane but scope users know exactly what a scope looks like so the expectations are high. This worked very well.
The only weirdness I had (under XP, visual studio 2008) was that the plot did not update when I deleted the old curve and plotted a new one, but if I clicked anywhere in the graph it would refresh. I finally found the graph.Refresh() which solved the problem.
|
|
|
|

|
what's your project's licence?
|
|
|
|

|
Your work helps me a lot. Thanks!
|
|
|
|

|
Hello! Does anyone know how to hide some parts on Xaxis? I have a list of points during the day, and want to hide blank spaces with no points at night. I can't use DateAsOrdinal,since points are spaced randomly. Anyone know how to work this around? Thank you.
|
|
|
|
|

|
Dariowiz: Thanks so much! I'll be happy when the zedgraph site is back online, too. I'm glad you had something available in the mean time.
|
|
|
|

|
is there a way to print zgraph?
|
|
|
|

|
yes there is, when you rightclick on zedgraph pane you can see a action print. also you can do it by code:
zedGraphControl.PrintDocument.Print();
|
|
|
|

|
I'm wondering if I can adjust the stroke size of a curve?
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Looking for a way to draw 2D line graphs with C#? Here's yet another charting class library with a high degree of configurability, that is also easy to use.
| Type | Article |
| Licence | |
| First Posted | 12 Nov 2003 |
| Views | 3,469,688 |
| Downloads | 118,806 |
| Bookmarked | 1,979 times |
|
|