Home > Net >  The application of the Chart in c #
The application of the Chart in c #

Time:10-27

I want to use weinform condition query is used to derive the maintenance data first, and display in datagriverview
According to the number of the maintenance data to draw a month for the x axis spline, y axis to query devices for the month of maintenance times;
I am using vs2010 and sql2008
O bosses told how to solve the
Today I see the code has the same idea, but I really don't understand to write is what meaning,,,
https://blog.csdn.net/Kang_xiong/article/details/53944487

CodePudding user response:

Why so slowly,,,,,,,,,

CodePudding user response:

This is a line chart, you in chronological (e.g., 2018) from 0 to 20

CodePudding user response:

refer to the second floor stevenjin response:
you ah, this is a line chart in chronological (e.g., 2018) from 0 to 20

I really is a line chart, I think after click statistics, the statistical values into the textbox, at the same time, according to the data in the datagriverview mapped the fluctuations in six months qing regime
Don't know how to connect the database data and graphics

CodePudding user response:

refer to the second floor stevenjin response:
you ah, this is a line chart in chronological (e.g., 2018) from 0 to 20

Can you add Q help the younger brother

CodePudding user response:


If such effect, DataGridView table and a Chart table, simple line Chart,

CodePudding user response:

Look straight to the MSDN MSChart control the properties of the method statement

CodePudding user response:

reference 5 floor m0_37137902 reply:

If such effect, DataGridView table and a Chart table, simple line Chart,

@ m0_37137902
Is a meaning similar to this, but I don't know how to make x show only the year and month

CodePudding user response:

refer to 7th floor qq_38325096 response:
Quote: refer to fifth floor m0_37137902 response:


If such effect, DataGridView table and a Chart table, simple line Chart,

@ m0_37137902
Is a meaning just like this, but I don't know how to let the x axis show only the year and month

The corresponding time data in the database in the X axis labels

CodePudding user response:

 
//add labels and values, AddXY (X axis labels, value);
Chart1. Series [0]. Points. AddXY (model. ProjectNumber, Int32. Parse (model. ProjectCount));
Chart1. Series [1]. Points. AddXY (model. ProjectNumber, Int32. Parse (model. NumberRemaining));

CodePudding user response:

references 9 f m0_37137902 response:
 
//add labels and values, AddXY (X axis labels, value);
Chart1. Series [0]. Points. AddXY (model. ProjectNumber, Int32. Parse (model. ProjectCount));
Chart1. Series [1]. Points. AddXY (model. ProjectNumber, Int32. Parse (model. NumberRemaining));

@ m0_37137902
Have been able to connect the data in the database and graphics, but I want to show the data of nearly six months, type in the database maintenance date is the date at the same time, contains (date) (month) (year), now I want to let the x axis for
Years, the date is based on the database maintenance, take a month to return interval, rather than the Japanese as a interval, is unlikely to limit the conditions,

CodePudding user response:

references to the tenth floor qq_38325096 response:
Quote: references 9 f m0_37137902 response:

 
//add labels and values, AddXY (X axis labels, value);
Chart1. Series [0]. Points. AddXY (model. ProjectNumber, Int32. Parse (model. ProjectCount));
Chart1. Series [1]. Points. AddXY (model. ProjectNumber, Int32. Parse (model. NumberRemaining));

@ m0_37137902
Have been able to connect the data in the database and graphics, but I want to show the data of nearly six months, type in the database maintenance date is the date at the same time, contains (date) (month) (year), now I want to let the x axis for
Years, the date is based on the database maintenance, take a month to return interval, rather than the Japanese as a interval, is unlikely to limit the conditions,

Modify the SQL statement, the time data in the database to then show every month

CodePudding user response:

Thank you, learned will be used

CodePudding user response:

 
///& lt; Summary>
///statistical graphs by the number of alarm time and site
///& lt;/summary>
Private void getAlarmHoistoryStat ()
{
Try
{
DateTime stat=dtpStat. Value. The Date;
DateTime end=dtpEnd. Value. Date. AddDays (+ 1);
//according to the user id for site information
String devlist=udBLL. GetListData (BaseCommData. BaseUser. USER_GUID);
DataTable dt=alarmBLL. GetAlarmSiteStat (devlist, stat, end);

If (dt!=null & amp; & Dt. Rows. Count & gt; 0)
{
The Series dataTable3Series=new Series (" alarm site number ");
//line segment configuration
DataTable3Series. Color=Color. Red;//line color
DataTable3Series. BorderWidth=3;//line thicknesses
DataTable3Series. MarkerBorderColor=Color. Red; Border color//marked points
DataTable3Series. MarkerBorderWidth=3;//markers in border size
DataTable3Series. MarkerColor=Color. Red; Center color//marked points
DataTable3Series. MarkerSize=5;//marker point size
DataTable3Series. MarkerStyle=MarkerStyle. Circle;//markers in type

DataTable3Series. Points. DataBind (dt) AsEnumerable (), "alarmdate", "siteCount", "");
DataTable3Series. Label="# VAL";//set the display value of X Y
//dataTable3Series ToolTip="# VALX years \ r# VAL".//mouse point to the corresponding display value
DataTable3Series. XValueType=ChartValueType. Date;//set the X axis type for time
DataTable3Series. ChartType=SeriesChartType. Line;//set the Y axis to the line

This. Chart1. Titles. The Clear ();

This. Chart1. Titles. The Add (" alarm site number trend chart ");
Chart1. Series. The Clear ();

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C#
  • Related