|
how to add bar graph / cnadlesticks ?
|
|
|
|
|
|
I have problems with when I use the cursor on a graph.
First, on some points, there are recognized when the cursor is not really on the point.
Then, there are some points which are not recognized by the cursor. I thought it was a problem of scale but even when I use the zoom, these points are not recognized. However, when I select the point ( not in cursor mode, it's recognized(a hand appears)).
Thanks you to anyone who will able to solve my problem.
Seb
|
|
|
|
|
any Idea how to set Legend on the Bottom of the Graph correct
Here is my code
if (m_LegendAlignment == bottom)
{
legendRect.SetRect (ChartRect.left + 10, ChartRect.top + 10, ChartRect.left + 10 + nLegendWidth,ChartRect.top + 12 + nLegendHeight);
ChartRect.bottom += (nLegendWidth + 20);
}
but when the size of the Legend different I get missing Legend in the Graph
|
|
|
|
|
to place the legend under the graph, you need to add 10 to the ChartRect.bottom. You've been adding 10 to the ChartRect.top, which would place the legend in the middle of the graph.
clintMonari
|
|
|
|
|
I am having trouble with the pan mode. I am not using the right click pop-up menu for the commands, instead I have a toolbar with IDM_PAN IDM_ZOOM etc buttons. When I click the pan button, I am able to pan correctly. The problem is that after I get out of the pan mode by either a zoom or a reset command, the graph continues to pan with every mouse movement. Any help will be appreciated.
Thanks
|
|
|
|
|
Hi All,
Was the ACtiveX versio of this control ever distributed?
Dave
|
|
|
|
|
I use these to line in my program for using date and time in X axis
m_Graph.GetXAxis (m_nAxes).SetDateTime(TRUE);
m_Graph.GetXAxis (m_nAxes).SetDisplayFmt("%d.%m.%Y\r\n%H:%M:%S");
but it is not successfull becuase m_fStep is a very large number.
Could anybody help me?
|
|
|
|
|
Hi,
Firstly I want to thank Gunnar to share this control with all of us. My problem is: I've been trying to incorporate it to my MDI program and all is ok in DEBUG mode but not in RELEASE. I think the problem is when CMDIChildWindow tries to create the frame but I'm not sure.
Here is the declaration and creation of Template:
pDocTemplate = new CMultiDocTemplate(
IDR_DOCTYPE,
RUNTIME_CLASS(CTransCommand),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CXGraphTestView));
AddDocTemplate(pDocTemplate);
//I store it in a var
CMultiDocTemplate m_plantillaXGrafico = pDocTemplate;
and here is the error, when I try to create a new child window (This piece of code is called when a button on bar of the main frame is pushed for example):
CChildFrame* miFrame = (CChildFrame*)m_plantillaXGrafico- >CreateNewFrame(miDoc,NULL);
With this expresion I obtained these error:
Debug Asertion Failed
afxwin1.inl
Line 22
After that, I can ignore the error and continue and I get another error in method
CXGraphTestView::OnInitialUpdate()
...........
if (!::IsWindow(m_Graph.m_hWnd))
{
m_Graph.Create("XGraph","", WS_CHILD | WS_VISIBLE, clRect, this,1001);
..............
in the last line (m_Graph.Create ....)
Does somebody know what is happening? Coould you help me?
Thanks a million.
Esteban.
|
|
|
|
|
Sorry, I was in a mistake. I repley myself, the problem was I was trying to link my program which was in RELEASE mode with the library in DEBUG mode.
I didn't realize that were two different *.dll modes: XGRAPH10.dll and XGRAPH10d.dll
the second one in DEBUG mode. Now all is ok and works.... I'm lying , I have a new problem when I try to draw series with a number of points over 10000 I get a memory error. It doesn't happen with a less number of points , could it be because it's trying to access to virtual memory and cannot reserve it? I just realize of this a few hours ago, so it's time to debug. If somebody know the answer please.....let me know it?
Thanks again.
Esteban.
|
|
|
|
|
Has anyone created a static library of these sources? I need to use a static library in my project instead of a DLL. Dll version causes a lot of link conflicts with my other static libraries.
Thanks
|
|
|
|
|
Hi,
thank you for your quick answer. You performed a real powerfull tool!
I would like to know if your library can plot scatter graphs but without line.
I success with option scatter and marker to display data points.
However, markers are displayed just for 1 data point out of 2. That's why to display all my data points, I thought write all data in double to display all points.
But there is perhaps a better solution you know.
Thanks.
ps: Is your available online source version the latest or a very old?
Seb
|
|
|
|
|
Hi,
In my source, I would like to choose the option "Scatter" of the ComboBox Type of the curve index in the XGraph properties.
However, I don't want to change it on the Properties windows but directly from my source code.
When I try to call the "SetType" method, I think I need to use "gtScatter" with the "EGraphType" type. The problem is that a declaration of a variable of "EGraphType" type is not available.
I thanks you in advance for any help you could give me.
Seb
|
|
|
|
|
m_Graph.GetCurve(nCurve).SetType (CXGraphDataSerie::gtScatter);
that's it.
|
|
|
|
|
The calculation for the nMarkerCount is potentially unsafe.
int nMarkerCount = m_nCount / (m_pGraph->m_clInnerRect.Width() / m_nMarkerSize / 4);
you could change to something like this
int nDenominator = (m_pGraph->m_clInnerRect.Width() / m_nMarkerSize / 4);
int nMarkerCount = m_nCount / ((nDenominator != 0) ? nDenominator:1);
Ant.
|
|
|
|
|
How can I get the source code for the test program you are distributing in the binary form only. That project shows 4 different graphs and seems to use a lot more of the features. Can any one help?
Thanks
|
|
|
|
|
|
That file does contain the sources for the demo that is shown with the article. I was refering to the demo included in the following:
http://www.codeproject.com/miscctrl/XGraph/XGraph_bin.zip
Sorry for the confusion.
|
|
|
|
|
I have compiled the dll and the demo under VC7.
When exiting the demo in VS.NET, the environment warns me about a memory leak.
Here follows the oputput in mode debug:
XGRAPH.DLL Terminating!
Detected memory leaks!
Dumping objects ->
{948} normal block at 0x00E22238, 1504 bytes long.
Data: <e 9="" m=""> 45 00 00 00 39 01 00 00 4D 00 00 00 39 01 00 00
{933} normal block at 0x00E24910, 304 bytes long.
Data: <m y="" ^="" x=""> 4D 00 00 00 59 01 00 00 5E 00 00 00 58 01 00 00
{658} normal block at 0x00E22188, 24 bytes long.
Data: < .| > 10 FF 2E 7C 07 00 00 00 07 00 00 00 01 00 00 00
c:\documents and settings\agno\my documents\visual studio projects\xgraph\xgraph_src\xgraph.cpp(256) : {640} client block at 0x00E21798, subtype c0, 384 bytes long.
a CXGraphDataSerie object at $00E21798, 384 bytes long
{204} normal block at 0x00E21500, 24 bytes long.
Data: < .| > 10 FF 2E 7C 07 00 00 00 07 00 00 00 01 00 00 00
c:\documents and settings\agno\my documents\visual studio projects\xgraph\xgraph_src\xgraph.cpp(164) : {185} client block at 0x00E20D78, subtype c0, 376 bytes long.
a CXGraphDataSerie object at $00E20D78, 376 bytes long
Object dump complete.
The program '[3556] XGraphTest.exe: Native' has exited with code 0 (0x0).
It seems that the following pointer in xgraph.cpp is never deleted...
CXGraphDataSerie* serie=new CXGraphDataSerie();
Excellent project nonetheless ...
Regards,
agno
|
|
|
|
|
Sorry, in fact the version of CXGraph,I am working on had been modified by a colleague to allow new data types to be drawn.
The leak came from the changes he made on the original code!
Thanks again for this excellent dll ...
Regards,
Agno
|
|
|
|
|
Hi,
I try to use the DateTime-Mode for the XAxis.
I used double-Values as Input-Types for the X-Axis.
Then I set the DateTime-Mode with setDateTime(true) of the related XAxis.
Without any success.
The labels of the X-Axis are error-outputs of failed Date-to-String conversions.
Has anybody used this feature?
Thanks
Marco
|
|
|
|
|
You need to set the format as follows:
m_Graph.GetXAxis (m_nAxes).SetDisplayFmt("%H:%M:%S");
and you need to ensure that the data is a float representation of system time e.g.
m_nvVariables[i]->vData.push_back(float(hr/24+min/(24*60)+sec/(24*3600)));
Hope this helps.
|
|
|
|
|
Hello
I don't know where to put this part. I don't get any datetime axis...
m_nvVariables[i]->vData.push_back(float(hr/24+min/(24*60)+sec/(24*3600)));
Could someone please give a sample that works with datetime ????
Thank you in advance !
|
|
|
|
|
first set the desired axis to datetime mode :
m_Graph.GetXAxis (0).SetDateTime(true);
then setup the format string, e.g. :
m_Graph.GetXAxis (0).SetDisplayFmt("%d.%m.%Y\r\n%H:%M:%S");
As mentioned before the x-axis time data must be provided as float values,
take a look at COleDateTime and COleDateTimeSpan
hope this helps
|
|
|
|
|
I have turned this into an ActiveX Control ...for ease of use...
But I dont know where to post it?
I would rather send the modified code to Gunnar.
JSW
|
|
|
|