Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Multi X-Axis(Calendar)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ahang

8 Posts

Posted - 13 Mar 2009 :  05:33:41  Show Profile  Reply with Quote
Hi~ :D

I'm implementing a chart component with QCChart2D.
It can draw multiple plots with different plot type and Y-value sets.

But, How can I draw multi plots with different X-Axis sets ?


Describe picture,
[ I can't attach to sample image!]


As you see the picture,

I have two dataset. (for BarChart and LinePlot)

The range of X-axis of BarChart is from 0:00:00 to 0:10:00.

And the range of X-axis of LinePlot is from 0:00:00 to 0:05:00.

So, I expected 6 Points of LinePlot plotted at the same position of first six bar.

But in this picture, as you may see, scale of time domain of LinePlot was enlarged.

I don't want enlarged scale of x-axis, I just want to plot the data of LinePlot at
same time position of bar chart.

How can I do this thing?

Pleas confirm me your help.

SMILE

quinncurtis

1164 Posts

Posted - 13 Mar 2009 :  07:42:57  Show Profile  Reply with Quote
You can display multiple x-axes using exactly the same logic as multiple y-axes. Create two coordinate systems and add the corresponding axes and plots to each. Exactly as if you were creating two different plots, overlaying one another. In order to prevent the x-axes from writing over one another, offset the second x-axis, either below the first, or above, at the top of the plot area. You would offset an x-axis using the axis SetAxisIntercept property. Read the FAQ #2 section on multiple axes: http://www.quinn-curtis.com/QCChart2DFAQs.htm. Something like:

LinearAxis xAxis2 = new LinearAxis(pTransform2, ChartObj.X_AXIS);

xAxis2.SetAxisIntercept(yAxis.GetAxisMax());

xAxis2.SetAxisTickDir(ChartObj.AXIS_MAX);

chartVu.AddChartObject(xAxis2);

where pTransform2 is the second of your coordinate systems.

You can post a picture if you can add it to a web site (your own or one of the many public web sites for this) and reference a URL. Below is a picture from our ChartAxes demo program, posted to the free ImageShack picture posting site (http://imageshack.us/). If you are unable to to that you can send a picture to us in an e-mail to support@quinn-curtis.com.


Go to Top of Page

ahang

8 Posts

Posted - 15 Mar 2009 :  21:33:30  Show Profile  Reply with Quote
Thanks for your reply :D

but, I knew that I can use multiple x-axes include the example.




¨ç 6 points (0:00 ~ 0:05)
¨è 11 points (0:00 ~ 0:10)
¨é X-axis of the image-¨ç is enlarged
¨ê I wanna display one union x-axis include multiple x-axes as picture.
(even if dataset is totally different like [0:00~0:05] with [1:10~1:30])

Thanks ^---^ b

SMILE

Edited by - ahang on 15 Mar 2009 21:39:23
Go to Top of Page

quinncurtis

1164 Posts

Posted - 16 Mar 2009 :  09:28:39  Show Profile  Reply with Quote
Sorry, but are still not sure what you want. We do not understand what "I wanna display one union x-axis include multiple x-axes as picture" means.

Here is just a wild guess. Assuming that picture 3 is what you actually want, except you don't want the double x-axes. Create the coordinate system (pTransform1), and line plot, for the 0 to 0:05:00 scale, just don't create the first x-axis, and x-axis labels. Leave everything else the same. That way you will get the line plot for pTransform1, and the bar plot and the axes for pTransform2. Perhaps we are having a hard time understanding because it is so obvious to us.

TimeCoordinates pTransform1 = new TimeCoordinates();
pTransform1.AutoScale(DatasetArray, ChartObj.AUTOAXES_FAR , ChartObj.AUTOAXES_FAR);
.
.

// Just comment out the x-axis objects for the first plot

//TimeAxis xAxis1 = new TimeAxis(pTransform1);
//chartVu.AddChartObject(xAxis1);


//TimeAxisLabels xAxisLab1 = new TimeAxisLabels(xAxis1 );
//chartVu.AddChartObject(xAxisLab1);










Go to Top of Page

ahang

8 Posts

Posted - 16 Mar 2009 :  20:03:51  Show Profile  Reply with Quote
Hi~

Picture 1 is still Ok~
Picture 2 is still Ok~

But, Picture 3 is what I don't want ...
(I want that X-position of the LinePlot is rearranged like Picture 4)
Picture 4 is what I want ... !!

Could you focus it on X-axis of the LinePlot of picture 3~4 .. ?!

Thanks~~

SMILE
Go to Top of Page

quinncurtis

1164 Posts

Posted - 16 Mar 2009 :  20:36:20  Show Profile  Reply with Quote
Ok. So now we assume that you want two coordinate systems. They both have the same x-scale but different y-scales. Is this correct ?

First of all, you can just define coordinate system explicitly. The manual discusses this.

Or, you can just set the x-scale of the coordinate system that has the scale you don't want to the scale you do want.

After you define pTransform2, which we assume you doing using one of the AutoScale routines, set the x-scale of the first coordinate system to match the second.


pTransform1 = new TimeCoordinates();
pTransform1.AutoScale(Dataset1,ChartObj.AUTOAXES_NEAR, ChartObj.AUTOAXES_NEAR);

pTransform2 = new TimeCoordinates();
pTransform2.AutoScale(Dataset2,ChartObj.AUTOAXES_NEAR, ChartObj.AUTOAXES_NEAR);


pTransform1.XScale = pTransform2.XScale;

Go to Top of Page

ahang

8 Posts

Posted - 16 Mar 2009 :  21:49:22  Show Profile  Reply with Quote
Thank u a lot :D ~

SMILE
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07