Line chart is the basic chart type commonly used in variable fields. Line chart is designed to show series of data points, which are named as markers and combined with a straight line to display particular trends within a period of time. Like many chart types, line chart also can contain and display multiple series of data in separate single line. For some reason, you maybe want to flex two or more types to one chart, such as draw line chart and bar chart together, or line chart and point chart together, and Kettic asp.net chart control can do this for you. But stacked line chart is not supported, if you want, you can make stacked bar chart and stacked area chart.
As one of the most comprehensive UI for ASP.NET AJAX libraries, KT.UI for ASP.NET AJAX Line Chart control enables users to easily draw and individualize line chart with rich and mature chart options, for instance, the appearance of each data series can be modified with different color, the line thickness is adjustable, and so on so forth. You can make line chart in our online demo for line chart.
Sample line image created by using KT.UI Chart creating library within ASP.NET application:
How to Build a Simple Line Chart
Like we promised, KT.UI for ASP.NET provides not only the advanced and comprehensive chart components, but also the complete developing guides. Please read this part carefully to be well informed of drawing a simple line chart.
First, we need to drag an "AjaxPanel" control to "aspx" file to realize effect of Ajax technique and before we implement following specific operation steps, we need to drag a chart control from toolbox into AjaxPanel.
At the very beginning, we are supposed to learn how to choose the required chart type - line chart. After this, we can use chart title, chart orientation and chart skin components to customize line chart appearance and template, and all of which are listed in chart property window.
Here we supply another way to customize the basic line chart properties as in aspx mode, using C# code to change the settings, you can find it's simple and easy to do.
Now, let's come to the most important part of line chart - that is how to set data series. Technically speaking, we can insert multiple sets of data series within a line chart, and the particular data points contained in a series of data are user-defined. Additional, you can define the legend by the data groups, it shows each category name.
Following tutorial codes shows how to add two series of data points, if you have more values need to be shown on line chart, you can refer to "ChartSeries.Items" to have a modification.
Chart series is one of the indispensable elements to char, and of course, we can use the method of "ChartSeries.StyleSet.Fill.PrimaryColor" to define the line color. If you are interested, check out more settings of series: Chart Series Element. In the last part, we will introduce you how to set chart axis in C#, the spacing and scaling of axis are changing the appearance and size of whole line chart graph. Following is some CSharp example code.
If you still need the manual on creating line chart using c# programming language, go to: C# codes to build line chart.
ASP.NET AJAX UI Controls