Display drawing notes on the web under zedgraph

Source: Internet
Author: User

Codeproject is good, but some details are different.

Private void zgcreategraph (zedgraph. Web. zedgraphweb webobject, system. Drawing. Graphics g, zedgraph. masterpane pane)
{
// Obtain a graphpane reference
Graphpane mypane = pane [0];

// Set the title
Mypane. Title. Text = "my test bar graph ";
Mypane. xaxis. Title. Text = "label ";
Mypane. yaxis. Title. Text = "My Y axis ";

// Make up some random data points
String [] labels = ", "August September", "August October", "August November", "August December "};
Double [] Y = {100,115, 75, 22, 98, 40, 90,100, 95, 35, 80, 35 };

// Initialize the bar
Baritem mybar;

// Create a column chart
Mybar = mypane. addbar ("Number of cases", null, Y, color. Green );
Mybar. Bar. Fill = New fill (color. Green, color. White, color. Green );

// Create a curve
Lineitem mycurve = mypane. addcurve ("Number of cases", null, Y, color. Black, symboltype. Circle );
Mycurve. Line. Fill = New fill (color. White, color. lightskyblue,-45f );

// Set the curve style
Mycurve. symbol. size = 8.0f;
Mycurve. symbol. Fill = New fill (color. White );
Mycurve. Line. width = 2.0f;

// Specify that each bar is displayed between two labels.
Mypane. xaxis. majortic. isbetweenlabels = true;

// Set the X axis Scale
Mypane. xaxis. Scale. textlabels = labels;
// Set the X axis scale type
Mypane. xaxis. type = axistype. text;

// Set the chart Style
Mypane. Chart. Fill = New fill (color. White, color. fromargb (255,255,166), 90f );
Mypane. Fill = New fill (color. fromargb (250,250,255 ));

// Display
Pane. axischange ();
}

In this method, there are three parameters passed by the control. that is to say, the control has a render event, and the events are automatically delegated with these three parameters. this is very different from winform.
In addition, when Asp.net is lowered, it may prompt that a PNG file cannot be found, which is also a good solution. In the project, create a directory according to what it says, in fact, this error is equivalent to telling you that zedgraph requires a temporary directory, but you have not created it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.