|
I need to create a high low chart only |
Posted by Wajid Ali on Dec-02-2010 14:40 |
|
I was working over HLOC but now need an high low chart for the front page.
Please provide any thing as I am unable to search a thing.
lets see for example here is my code:
or if we need to use Finance chart?
query = objencript.Encrypt(query, true);
System.Data.DataSet dtChart = objBlayer.fetch_dataset(query);
// The data for the area chart
double[] data = new double[dtChart.Tables[0].Rows.Count];
// The labels for the area chart
string[] labels = new string[dtChart.Tables[0].Rows.Count];
for (int i = 0; i < dtChart.Tables[0].Rows.Count; i++)
{
data[i] = Convert.ToDouble(dtChart.Tables[0].Rows[i][1].ToString());
labels[i] = "";///Convert.ToDateTime(dtChart.Tables[0].Rows[i][0].ToString()).ToString("yyyy-MM-dd");
}
// Create a XYChart object of size 300 x 300 pixels
XYChart c = new XYChart(160, 160);
// Set the plotarea at (45, 30) and of size 200 x 200 pixels
c.setPlotArea(45, 30, 100, 100);
// Add a title to the chart using 12 pts Arial Bold Italic font
c.addTitle("SBPDR", "Arial Bold Italic", 08);
// Add a title to the y axis
c.yAxis().setTitle("");
// Add a title to the x axis
c.xAxis().setTitle("");
// Add a green (0x00ff00) 3D area chart layer using the give data
c.addAreaLayer(data, 0x0094ef).set3D();
// Set the labels on the x axis.
c.xAxis().setLabels(labels);
// Display 1 out of 3 labels on the x-axis.
c.xAxis().setLabelStep(3);
// output the chart
viewer.Image = c.makeImage();
//include tool tip for the chart
viewer.ImageMap = c.getHTMLImageMap("clickable", "",
"");
Thanks |
Re: I need to create a high low chart only |
Posted by Peter Kwan on Dec-03-2010 02:29 |
|
Hi Wajid Ali,
There is a sample code included in ChartDirector called "High-Low-Open-Close Chart". It plots a HLOC chart. If you want to plot HL only, you can use empty arrays for the open and close data series. In this case, ChartDirector will only plot the High-Low part of the OHLC symbol.
Hope this can help.
Regards
Peter Kwan |
|