Dear Sir\Madam
I am using the C++ component of Visual Studio 2008
I use a scColorGrid.
Data is entered into the grid in a sequence read from a file for instance the numeric value of 1 to 100 and displayed as follows
|5 10 15 100
|4 9 14 99
|3 8 13 98
|2 7 12......... 97
|1 6 11......... 96
|_____________________
In essence bottom to top, left to right
I would like the data to be displayed as follows:
|
|16 17 18 19 20
|11 12 13 14 15
|6 7 8 9 10
|1 2 3 4 5
|_________________________
but without changing the sequence of entering the data to the VARIANT that passes the data to the chart
Regards
Jacques
Swapping the x and z axis on a scColorGrid
Re: Swapping the x and z axis on a scColorGrid
Hi Jacques,
I think you could try using GridTranspose tool? Something like following (this is Visual Basic 6):
I think you could try using GridTranspose tool? Something like following (this is Visual Basic 6):
Code: Select all
TChart1.Tools.Add tcGridTranspose
TChart1.Tools.Items(0).asGridTranspose.Series = TChart1.Series(0)
TChart1.Tools.Items(0).asGridTranspose.Transpose
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Swapping the x and z axis on a scColorGrid
I translated the Visual basic to C++ as follows:
1) m_ssdPlotControl->GetTools().Add(tcGridTranspose);
2) m_ssdPlotControl->GetTools().GetItems(0).GetAsGridTranspose().GetSeries() = m_ssdPlotControl->Series(0);
3) m_ssdPlotControl->GetTools().GetItems(0).GetAsGridTranspose().Transpose();
but I get the following error
1>c:\pds\projects\gew\cjpu_iii\sw\pc\tada\snapshotmodule.cpp(826) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'CSeries' (or there is no acceptable conversion)
1> c:\program files\microsoft sdks\windows\v6.0a\include\oaidl.h(492): could be 'tagVARIANT &tagVARIANT::operator =(const tagVARIANT &)'
for line 3 of the code.
Could you perhaps explain what I am doing wrong
1) m_ssdPlotControl->GetTools().Add(tcGridTranspose);
2) m_ssdPlotControl->GetTools().GetItems(0).GetAsGridTranspose().GetSeries() = m_ssdPlotControl->Series(0);
3) m_ssdPlotControl->GetTools().GetItems(0).GetAsGridTranspose().Transpose();
but I get the following error
1>c:\pds\projects\gew\cjpu_iii\sw\pc\tada\snapshotmodule.cpp(826) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'CSeries' (or there is no acceptable conversion)
1> c:\program files\microsoft sdks\windows\v6.0a\include\oaidl.h(492): could be 'tagVARIANT &tagVARIANT::operator =(const tagVARIANT &)'
for line 3 of the code.
Could you perhaps explain what I am doing wrong
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Swapping the x and z axis on a scColorGrid
Hi jaques,
You can do something like this:
You can do something like this:
Code: Select all
m_Chart1.Series(scSurface);
m_Chart1.Series(2).FillSampleValues(10);
m_Chart1.GetTools().Add(tcGridTranspose);
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().SetSeries(COleVariant("2"));
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().Transpose();
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Swapping the x and z axis on a scColorGrid
Hello Narcis,
I implemented your code :
m_Chart1.Series(scSurface);
m_Chart1.Series(2).FillSampleValues(10);
m_Chart1.GetTools().Add(tcGridTranspose);
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().SetSeries(COleVariant("2"));
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().Transpose();
I however changed it as follows:
m_Chart1.AddSeries(scSurface);
m_Chart1.Series(0).FillSampleValues(10);
m_Chart1.GetTools().Add(tcGridTranspose);
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().SetSeries(COleVariant(_T("0"))); // BECAUSE WE ARE USING UNICODE
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().Transpose();
I plotted the chart, afterwards I removed the transpose tool, thus only using
m_Chart1.AddSeries(scSurface);
m_Chart1.Series(02).FillSampleValues(10);
And the plot remains the same, the axis from left to right is indexed 1 to 10,I feel this is incorrect as I would expect the x and z axis to swap.
Regards
Jacques
I implemented your code :
m_Chart1.Series(scSurface);
m_Chart1.Series(2).FillSampleValues(10);
m_Chart1.GetTools().Add(tcGridTranspose);
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().SetSeries(COleVariant("2"));
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().Transpose();
I however changed it as follows:
m_Chart1.AddSeries(scSurface);
m_Chart1.Series(0).FillSampleValues(10);
m_Chart1.GetTools().Add(tcGridTranspose);
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().SetSeries(COleVariant(_T("0"))); // BECAUSE WE ARE USING UNICODE
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().Transpose();
I plotted the chart, afterwards I removed the transpose tool, thus only using
m_Chart1.AddSeries(scSurface);
m_Chart1.Series(02).FillSampleValues(10);
And the plot remains the same, the axis from left to right is indexed 1 to 10,I feel this is incorrect as I would expect the x and z axis to swap.
Regards
Jacques
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Swapping the x and z axis on a scColorGrid
Hi Jacques,
Code below works fine for me here. Can you please try if it works fine for you?
Thanks in advance.
Code below works fine for me here. Can you please try if it works fine for you?
Code: Select all
long surfa = m_Chart1.AddSeries(scSurface);
m_Chart1.Series(0).FillSampleValues(10);
m_Chart1.GetTools().Add(tcGridTranspose);
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().SetSeries(COleVariant(surfa));
m_Chart1.GetTools().GetItems(0).GetAsGridTranspose().Transpose();
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Swapping the x and z axis on a scColorGrid
This works fine.
Thank you very much.
Regards
JB
Thank you very much.
Regards
JB