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#)
 Draw lines at spec limits
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lilly

7 Posts

Posted - 28 Feb 2008 :  09:20:03  Show Profile  Reply with Quote
I am generating x bar or mean chart using Chart view class. I need to draw lines at specification limits as well as at control limits and fill with colors.

quinncurtis

1164 Posts

Posted - 28 Feb 2008 :  12:44:52  Show Profile  Reply with Quote
We are confused by your post, since you are also posting on the QCSPCChart forum.

Are drawing your own x bar chart from scratch using the QCChart2D chart routines and not using our QCSPCChart software ?

Or are you using one of the QCSPCChart control chart classes (SPCTimeVariableControlChart or SPCBatchVariableControl Chart ?
Go to Top of Page

lilly

7 Posts

Posted - 29 Feb 2008 :  10:30:28  Show Profile  Reply with Quote
I am drawing X bar chart using QCChart2D. I developed the chart and it is working fine. But, the requirement is draw lines at specification and control limits (not auto calculated limits) and fill with colors between lines. I am developing a web application. In order to draw lines at specification limits on my current chart what I need to do?

Thank you.
Go to Top of Page

quinncurtis

1164 Posts

Posted - 29 Feb 2008 :  10:55:43  Show Profile  Reply with Quote

Since you have created the chart from scratch, we assume that you know how to create datasets containing xy data points, and plot the datasets in one of the QCChart2D plot objects (SimpleLinePlot, SimpleBarPlot, SimpleScatterPlot, etc).

So if you want a simple horizontal line, you need a dataset containing two points. The y-value of both points will be your specification limit, and the x-value of the first point will be the starting x-value of your scale and the x-value of the second point will be the ending x-value of your scale.

For a time-based x-axis use a ChartCalendar array and a TimeSimpleDataset.

double speclimit = 30;
ChartCalendar[] xarray = { pTransform1.TimeScaleStart, pTransform1.TimeScaleStop };
double[] yarray = { speclimit, speclimit };
TimeSimpleDataset SpecLimitDataset = new TimeSimpleDataset("SpecLimit1", xarray, yarray);
SimpleLinePlot specLimitPlot = new SimpleLinePlot(pTransform1, SpecLimitDataset, new ChartAttribute(Color.Blue));
chartVu.AddChartObject(specLimitPlot);

For a simple double based x-axis, use double arrays, and a SimpleDataset

double speclimit = 30;
double[] xarray = { pTransform1.ScaleStartX, pTransform1.ScaleStopX };
double[] yarray = { speclimit, speclimit };
SimpleDataset SpecLimitDataset = new SimpleDataset("SpecLimit1", xarray, yarray);
SimpleLinePlot specLimitPlot = new SimpleLinePlot(pTransform1, SpecLimitDataset, new ChartAttribute(Color.Blue));
chartVu.AddChartObject(specLimitPlot);

Go to Top of Page

lilly

7 Posts

Posted - 29 Feb 2008 :  11:34:21  Show Profile  Reply with Quote
Thank you. Now I am able to draw lines at specification and control limits. How to add label at the lines to show what is spec limit and what is control limit ? Is it possible to fill the complete area between lines with color?

Thank you.
Go to Top of Page

quinncurtis

1164 Posts

Posted - 29 Feb 2008 :  11:54:24  Show Profile  Reply with Quote
There are many examples in the software of placing text in a chart. Start by reading Chapter 20 - Text Classes, in the QCChart2D Manual. Look at the example program MultiLinePlots.Multilines.

You can't fill between two arbitray SimpleLinePlot line plots. You can however create a LineGap plot using a group dataset, and the LineGap class. You should be able to use that to create the fill effect that you want. Read the manual about the LineGap class and study the MiscCharts.LineGap example program.
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