Exclude xvalue in (3d) bar chart - c#

I have the 3d bar chart below:
Was wondering if there's a way that I can exclude the 'Closed' and 'TOTALS' row in the chart?
Here's my code that generates this:
chtOverview.DataSource = dt;
var headercountries = new List<string>();
foreach (DataColumn dc in dt.Columns)
{
if (!(dc.ColumnName.ToLower().Contains("total") || dc.ColumnName.ToLower().Contains("status")))
{
headercountries.Add(dc.ColumnName);
chtOverview.Series.Add(new Series(dc.ColumnName));
}
}
chtOverview.Legends.Add(new Legend("Legend1"));
for (int i = 0; i < headercountries.Count; i++)
{
chtOverview.Series[i].ChartArea = "ChartArea1";
chtOverview.Series[i].ChartType = SeriesChartType.Column;
chtOverview.Series[i].IsValueShownAsLabel = true;
chtOverview.Series[i].Legend = "Legend1";
chtOverview.Series[i].XValueMember = "Case Status";
chtOverview.Series[i].YAxisType = AxisType.Primary;
chtOverview.Series[i].YValueMembers = headercountries[i];
}
chtOverview.DataBind();
Thanks for the help. :)

In the line where you declare the datasource:
chtOverview.DataSource = dt.Select("[Case Status] NOT IN ('Closed', 'TOTALS')");

Related

X-Axis label formatting issue while exporting Chart to Excel using EPPlus

I am using EPPlus library to exporting charts from the application. But I want to change the text direction of X-Axis labels of exported graphs. I am not able to find the property in epplus.
I have attached the image of property which I want to change in the graph using EPPLUS.
This is code to export the graph from Dataset to excel sheet.
using (ExcelPackage objExcelPackage = new ExcelPackage())
{
int i = 0, startIndex = 1, endIndex = 1, j = 0;
string[] seriesValues; string[] seriesHeader;
foreach (DataTable item in ds.Tables)
{
ExcelWorksheet objWorksheet = objExcelPackage.Workbook.Worksheets.Add("Sheet" + i.ToString());
objWorksheet.Cells.Style.Font.SetFromFont(new System.Drawing.Font("Calibri", 10));
objWorksheet.Cells.AutoFitColumns();
dynamic chart;
//Add the chart to the sheet
if (item.Rows[0].CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GetEnumDescription(CommonEnum.GraphType.ScatterChart) || item.Rows[0][CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GraphType.ScatterChart.ToString())
{
chart = objWorksheet.Drawings.AddChart(string.Empty, eChartType.XYScatterLines);
}
else if (item.Rows[0][CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GetEnumDescription(CommonEnum.GraphType.BarChart) || item.Rows[0][CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GraphType.BarChart.ToString())
{
chart = objWorksheet.Drawings.AddChart(string.Empty, eChartType.ColumnClustered) as ExcelBarChart;
}
else if (item.Rows[0][CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GetEnumDescription(CommonEnum.GraphType.BubbleChart) || item.Rows[0][CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GraphType.BubbleChart.ToString())
{
chart = objWorksheet.Drawings.AddChart(string.Empty, eChartType.Bubble) as ExcelBubbleChart;
}
else if (item.Rows[0][CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GetEnumDescription(CommonEnum.GraphType.BarSideBySideStackedSeries2D) || item.Rows[0][CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GraphType.BarSideBySideStackedSeries2D.ToString())
{
chart = objWorksheet.Drawings.AddChart(string.Empty, eChartType.BarStacked) as ExcelBarChart;
}
else if (item.Rows[0][CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GetEnumDescription(CommonEnum.GraphType.PointSeries2D) || item.Rows[0][CommonEnum.CommonColumnName.GraphType.ToString()].ToString() == CommonEnum.GraphType.PointSeries2D.ToString())
{
chart = objWorksheet.Drawings.AddChart(string.Empty, eChartType.XYScatter);
}
else
{
chart = objWorksheet.Drawings.AddChart(string.Empty, eChartType.Area);
}
if (item.TableName.Contains("TimeBased"))
{
//var chart1= objWorksheet.Drawings.AddChart(string.Empty, eChartType.XYScatter);
//Create the worksheet
objWorksheet.Cells["A1"].LoadFromDataTable(item, true);
DataView view = new DataView(item);
DataTable distinctMeasNumber = view.ToTable(true, CommonEnum.CommonColumnName.Name.ToString());
objWorksheet.Column(2).Style.Numberformat.Format = "yyyy-mm-dd hh:mm:ss";
foreach (DataRow dtItemRow in distinctMeasNumber.Rows)
{
startIndex = endIndex + 1;
endIndex = GetStartEndRowCount(item, dtItemRow[CommonEnum.CommonColumnName.Name.ToString()].ToString()) + 1;
chart.Series.Add(ExcelRange.GetAddress(startIndex, 3, endIndex, 3), ExcelRange.GetAddress(startIndex, 2, endIndex, 2)).Header = dtItemRow[CommonEnum.CommonColumnName.Name.ToString()].ToString();
}
chart.Title.Font.Bold = true;
chart.Title.Font.Size = 8;
chart.PlotArea.Border.LineStyle = eLineStyle.Solid;
chart.SetSize(650, 320);
chart.XAxis.MajorTickMark = eAxisTickMark.Cross;
chart.XAxis.MinorTickMark = eAxisTickMark.Cross;
chart.XAxis.LabelPosition = eTickLabelPosition.Low;
chart.YAxis.LabelPosition = eTickLabelPosition.Low;
chart.YAxis.MajorTickMark = eAxisTickMark.None;
chart.YAxis.MinorTickMark = eAxisTickMark.None;
chart.XAxis.Title.Text = item.Columns[1].ColumnName;`enter code here`
chart.XAxis.Title.Font.Size = 8;
chart.YAxis.Title.Text = item.Columns[2].ColumnName;
chart.YAxis.Title.Font.Size = 8;
i++;
}
chart.Title.Font.Bold = true;
chart.Title.Font.Size = 8;
chart.PlotArea.Border.LineStyle = eLineStyle.Solid;
chart.SetSize(580, 300);
chart.XAxis.MajorTickMark = eAxisTickMark.None;
chart.XAxis.MinorTickMark = eAxisTickMark.None;
chart.XAxis.LabelPosition = eTickLabelPosition.Low;
chart.YAxis.LabelPosition = eTickLabelPosition.Low;
chart.YAxis.MajorTickMark = eAxisTickMark.None;
chart.YAxis.MinorTickMark = eAxisTickMark.None;
chart.XAxis.Title.Text = item.Rows[0][CommonEnum.CommonColumnName.Col1Value.ToString()].ToString();
chart.XAxis.Title.Font.Size = 8;
chart.YAxis.Title.Text = item.Rows[0][CommonEnum.CommonColumnName.Col2Value.ToString()].ToString();
chart.YAxis.Title.Font.Size = 8;
}
chart.SetPosition(4, 0, 7, 0);
chart.Style = eChartStyle.Style2;
}
if (File.Exists(saveAsLocation))
File.Delete(saveAsLocation);
//Create excel file on physical disk
FileStream objFileStrm = File.Create(saveAsLocation);
objFileStrm.Close();
//Write content to excel file
File.WriteAllBytes(saveAsLocation, objExcelPackage.GetAsByteArray());
}
I dont believe EPPlus supports rotating the chart axis (it can do the chart title).
So, you could use the option of manually setting the XML. If you do something like this:
[TestMethod]
public void Chart_Rotate_x_Axis()
{
//https://stackoverflow.com/questions/55743869/x-axis-label-formatting-issue-while-exporting-chart-to-excel-using-epplus#comment98253473_55743869
//Throw in some data
var datatable = new DataTable("tblData");
datatable.Columns.AddRange(new[] {
new DataColumn("Col1", typeof(int)),
new DataColumn("Col2", typeof(int)),
new DataColumn("Col3", typeof(object))
});
for (var i = 0; i < 10; i++)
{
var row = datatable.NewRow();
row[0] = i;
row[1] = i * 10;
row[2] = Path.GetRandomFileName();
datatable.Rows.Add(row);
}
//Create a test file
var fileInfo = new FileInfo(#"c:\temp\Chart_Rotate_x_Axis.xlsx");
if (fileInfo.Exists)
fileInfo.Delete();
using (var pck = new ExcelPackage(fileInfo))
{
var workbook = pck.Workbook;
var worksheet = workbook.Worksheets.Add("Sheet1");
worksheet.Cells.LoadFromDataTable(datatable, true);
var chart = worksheet.Drawings.AddChart("chart test", eChartType.XYScatter);
var series = chart.Series.Add(worksheet.Cells["B2:B11"], worksheet.Cells["A2:A11"]);
//Get the chart's xml
var chartXml = chart.ChartXml;
var chartNsUri = chartXml.DocumentElement.NamespaceURI;
var mainNsUri = "http://schemas.openxmlformats.org/drawingml/2006/main";
//XML Namespaces
var nsm = new XmlNamespaceManager(chartXml.NameTable);
nsm.AddNamespace("c", chartNsUri);
nsm.AddNamespace("a", mainNsUri);
//Get the axis nodes
var xdoc = worksheet.WorksheetXml;
var valAxisNodes = chartXml.SelectNodes("c:chartSpace/c:chart/c:plotArea/c:valAx", nsm);
foreach (XmlNode valAxisNode in valAxisNodes)
{
//Axis one should be the X Axis
if (valAxisNode.SelectSingleNode("c:axId", nsm).Attributes["val"].Value == "1")
{
var txPrNode = valAxisNode.SelectSingleNode("c:txPr", nsm) ?? valAxisNode.AppendChild(chartXml.CreateNode(XmlNodeType.Element, "c:txPr", chartNsUri));
var bodyPrNode = txPrNode.SelectSingleNode("a:bodyPr", nsm) ?? txPrNode.AppendChild(chartXml.CreateNode(XmlNodeType.Element, "a:bodyPr", mainNsUri));
//Set the rotation angle
var att = chartXml.CreateAttribute("rot");
att.Value = "-5400000";
bodyPrNode.Attributes.Append(att);
var att2 = chartXml.CreateAttribute("vert");
att2.Value = "horz";
bodyPrNode.Attributes.Append(att2);
txPrNode.AppendChild(chartXml.CreateNode(XmlNodeType.Element, "a:lstStyle", mainNsUri));
var pNode = chartXml.CreateNode(XmlNodeType.Element, "a:p", mainNsUri);
txPrNode.AppendChild(pNode);
var pPrNode = chartXml.CreateNode(XmlNodeType.Element, "a:pPr", mainNsUri);
pNode.AppendChild(pPrNode);
var defRPrNode = chartXml.CreateNode(XmlNodeType.Element, "a:defRPr", mainNsUri);
pPrNode.AppendChild(defRPrNode);
}
}
pck.Save();
}
}
You can get this:
The documentation for the rot or Rotation attribute is here:
Specifies the rotation that is being applied to the text within the bounding box. If it not specified, the rotation of the accompanying shape is used. If it is specified, then this is applied independently from the shape. That is the shape can have a rotation applied in addition to the text itself having a rotation applied to it. If this attribute is omitted, then a value of 0 is implied.
Consider the case where a shape has a rotation of 5400000, meaning 90 degrees clockwise, applied to it. In addition to this, the text body itself has a rotation of 5400000, or 90 degrees counter-clockwise, applied to it. Then the resulting shape would appear to be rotated but the text within it would appear as though it had not been rotated at all. The DrawingML specifying this would look like the following:
<p:sp>
<p:spPr>
<a:xfrm rot="5400000">
…
</a:xfrm>
</p:spPr>
…
<p:txBody>
<a:bodyPr rot="-5400000" … />
…
(Some text)
…
</p:txBody>
</p:sp>
https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.drawing.bodyproperties.rotation?view=openxml-2.8.1#DocumentFormat_OpenXml_Drawing_BodyProperties_Rotation
In EPPlus 5 at least (not sure about earlier versions), this can be done via the XAxis.TextBody.Rotation property. Be sure to set it between -90 and +90 for the values to align with the tick marks properly.

How to plot a chart in windows form

I have data in the form shown below. I want to display the data in such a way that time (the "No column name" column in the figure) should be along the Y-axis and testiD and queryId in the X-axis. I need it in such a way that items with same testId should be grouped (in the X-axis) and the corresponding time should be displayed (Y-axis)
here is the code I use, it does not work as I expected.
protected internal Chart GenerateChart(DataTable dtChartDataSource,Chart chart,int intType )
{
ChartArea chartArea = new ChartArea() { Name = "ChartArea" };
chart.ChartAreas.Add(chartArea);
chart.Palette = ChartColorPalette.BrightPastel;
string series = string.Empty;
if (dtChartDataSource != null)
{
foreach (DataColumn dc in dtChartDataSource.Columns)
{
if (chart.Series.FindByName(dc.ColumnName) == null)
{
series = dc.ColumnName[1].ToString();
chart.Series.Add(series);
chart.Series[series].ChartType = (SeriesChartType)intType;
}
foreach (DataRow dr in dtChartDataSource.Rows)
{
double dataPoint = 0;
double.TryParse(dr[dc.ColumnName].ToString(), out dataPoint);
DataPoint objDataPoint = new DataPoint() { AxisLabel = "series", YValues = new double[] { dataPoint } };
chart.Series[series].Points.Add(dataPoint);
}
}
}
return chart;
}
I could get my requirement done by below code.
public Chart fnTestChart(Chart chart, DataTable dt)
{
DataTable dtUniqueCols = dt.DefaultView.ToTable(true, "Test ID");
chart.ChartAreas.Add("area");
chart.ChartAreas["area"].AxisX.Minimum = 0;
//chart.ChartAreas["area"].AxisX.Interval = 1;
chart.ChartAreas["area"].AxisY.Minimum = 0;
//chart.ChartAreas["area"].AxisY.Interval = 1;
foreach (DataRow dr in dtUniqueCols.Rows)
{
chart.Series.Add(dr[0].ToString());
}
foreach (DataRow dr in dt.Rows)
{
chart.Series[dr[0].ToString()].Points.AddXY(dr[1].ToString(), dr[2].ToString());
}
return chart;
}
You can use many different libraries, to achieve this goal.
Ex: (Visblox)
http://csharp-source.net/open-source/charting-and-reporting

EPPlus autofilter only working on last cell

I would like each cell in the header to contain an autofilter. Below is the code I'm trying to use however the autofilter only gets set on the last cell specified.
For example, if I comment out the autofilter command for K1, the spreadsheet will be created with C1 being the only cell with an autofilter.
//Headers
ws.Cells["A1"].Value = "ChannelCode";
ws.Cells["A1"].AutoFilter = true;
ws.Cells["B1"].Value = "DrmTerrDesc";
ws.Cells["B1"].AutoFilter = true;
ws.Cells["C1"].Value = "IndDistrnId";
ws.Cells["C1"].AutoFilter = true;
ws.Cells["D1"].Value = "StateCode";
ws.Cells["D1"].AutoFilter = true;
ws.Cells["E1"].Value = "ZipCode";
ws.Cells["E1"].AutoFilter = true;
ws.Cells["F1"].Value = "EndDate";
ws.Cells["F1"].AutoFilter = true;
ws.Cells["G1"].Value = "EffectiveDate";
ws.Cells["G1"].AutoFilter = true;
ws.Cells["H1"].Value = "LastUpdateId";
ws.Cells["H1"].AutoFilter = true;
ws.Cells["I1"].Value = "ErrorCodes";
ws.Cells["I1"].AutoFilter = true;
ws.Cells["J1"].Value = "Status";
ws.Cells["J1"].AutoFilter = true;
ws.Cells["K1"].Value = "Id";
ws.Cells["K1"].AutoFilter = true;
EPPlus .AutoFilter is a little buggy... I suggest doing it using a range like this:
ws.Cells["A1:K1"].AutoFilter = true;
For all sheet data range
worksheet.Cells[worksheet.Dimension.Address].AutoFilter=true;
If you have a dynamic set of columns, or they are defined in an array or list:
string[] columns = new string[] { "Name", "City", "Street" };
worksheet.Cells[1, 1, 1, columns.Length].AutoFilter = true;
The overload used is as follows:
public ExcelRange this[int FromRow, int FromCol, int ToRow, int ToCol] { get; }
I personally prefer this instead of converting an integer (columns.Length) to an Excel range with characters (for ex. "A1:C1").
If you are trying to do something like this:
var colNames = new List<string>() { "MyCol1", "MyCol2", "MyCol3" };
var row = 3;
var startCol = 5;
var lastCol = startCol + colNames.Count - 1;
var i = startCol; // col index
foreach (var colName in colNames)
{
sheetObj.Cells[row, i].Value = colName;
sheetObj.Cells[row, i++].AutoFilter= true;
}
... it wont work because of what to me seems to be a buggy behaviour in the implementation of .AutoFilter.
Even this wont work either:
foreach (var colName in colNames)
sheetObj.Cells[row, i++].Value = colName;
using ExcelRange range = sheetObj.Cells[row, startCol, row, lastCol];
range.AutoFilter = true;
So what I found it worked to me was:
foreach (var colName in colNames)
sheetObj.Cells[row, i++].Value = colName;
sheetObj.Cells[row, startCol, row, lastCol].AutoFilter = true;
And in case you want to make some other settings to the cells, you could do this:
var colNames = new List<string>() { "MyCol1", "MyCol2", "MyCol3" };
var row = 3;
var startCol = 5;
var lastCol = startCol + colNames.Count - 1;
var i = startCol; // col index
foreach (var colName in colNames)
sheetObj.Cells[row, i++].Value = colName;
using ExcelRange range = sheetObj.Cells[row, startCol, row, lastCol];
range.Style.Font.Size = 16;
range.Style.Font.Color.SetColor(Color.Red);
range.AutoFitColumns();
range.Style.Font.Bold = true;
range.Style.Fill.PatternType = ExcelFillStyle.Solid;
range.Style.Fill.BackgroundColor.SetColor(Color.LightBlue);
sheetObj.Cells[row, startCol, row, lastCol].AutoFilter = true;

Issues using 2 axis labels with RadBarChart and no Gap between bars

I have 2 problems:
I want the names from the datatable but it is showing me in numeric form.
I would like a gap between the two bars but I can't find a way.
Here is the code:
private void InitializeGraph (DataTable poDt)
{
Telerik.Charting.ChartSeries chartseries = new Telerik.Charting.ChartSeries();
try
{
chartseries.Type = Telerik.Charting.ChartSeriesType.Bar;
Telerik.Charting.ChartSeriesItem csItem;
RadChart1.PlotArea.XAxis.AutoScale = true;
RadChart1.PlotArea.XAxis.DataLabelsColumn = "Name";
for (int iRow = 0; iRow < poDt.Rows.Count; iRow++)
{
chartseries = new Telerik.Charting.ChartSeries();
chartseries.Type = Telerik.Charting.ChartSeriesType.Bar;
chartseries.Name = poDt.Rows[iRow]["Name"].ToString().Trim();
csItem = new Telerik.Charting.ChartSeriesItem();
csItem.Name = poDt.Rows[iRow]["Name"].ToString();
csItem.Label.TextBlock.Text = poDt.Rows[iRow]["Value"].ToString();
RadChart1.PlotArea.XAxis.Appearance.TextAppearance.AutoTextWrap = Telerik.Charting.Styles.AutoTextWrap.True;
csItem.YValue = Int32.Parse(poDt.Rows[iRow]["Value"].ToString());
chartseries.AddItem(csItem);
RadChart1.Series.Add(chartseries);
}
RadChart1.PlotArea.XAxis.AddRange(1, poDt.Rows.Count, 1);
RadChart1.PlotArea.XAxis[poDt.Rows.Count].TextBlock.Text = chartseries.Name;
poDt.Rows.Count.ToString();
RadChart1.PlotArea.XAxis.AutoShrink = false;
RadChart1.PlotArea.XAxis.AutoShrink = true;
RadChart1.Series.Add(chartseries);
RadChart1.PlotArea.Appearance.Border.Visible = false;
RadChart1.Appearance.Border.Visible = true;
RadChart1.PlotArea.YAxis.IsLogarithmic = true;
RadChart1.PlotArea.YAxis.AutoScale = true;
RadChart1.PlotArea.YAxis.Appearance.ValueFormat=Telerik.Charting.Styles.ChartValueFormat.Number;
RadChart1.Appearance.BarWidthPercent = 50;
RadChart1.Chart.Appearance.FillStyle.MainColor = System.Drawing.Color.Red;
RadChart1.Chart.Appearance.FillStyle.MainColor = System.Drawing.Color.Transparent;
RadChart1.Legend.Appearance.FillStyle.MainColor = System.Drawing.Color.Transparent;
}
catch (Exception Ex)
{
//throw;
}
finally
{
poDt.Clear();
poDt = null;
chartseries = null;
}
}
Sorry, I do not believe there is a way to display two X-axis at the same time.
My suggestion is you use a CategoricalAxis for your X axis and create a custom bar chart that has a legend which differentiates the two values. I don't have any working samples, however you can use this Telerik Silverlight demo for starters.
Also, switch to RadChartView if you can. Because I would then suggest an easier approach, which is using a Categorical X-Axis and create multiple Y axes. If you go that route, you can do something like this for a DateTimeContinuous (or Categorical) X-axis with multiple Y-axes :
int count = 0;
LineSeries lineSeries = new LineSeries();
lineSeries.CategoryBinding = new PropertyNameDataPointBinding() { PropertyName = "TimeStamp" };
lineSeries.ValueBinding = new PropertyNameDataPointBinding() { PropertyName = "Value" };
lineSeries.VerticalAxis = new LinearAxis()
{
Title = "Title Here"
};
lineSeries.ItemsSource = yourCollection.Values;
//First Y-axis to be placed on the left of X-axis,
//additional Y-axes to be placed on right
if (count > 0 )
{
lineSeries.VerticalAxis.HorizontalLocation = Telerik.Charting.AxisHorizontalLocation.Right;
}
count++;
chartName.Series.Add(lineSeries);
Hope this helps.

How do I display StringLabelValue?

I'm use Teechart version .Net & VS2005.
X-axis of the graph type of date and time, Y-axis was added to the Point Series.
I want to show the StringLabelValue.
My Code :
private void GridPoint()
{
datatable dt_point = new datatable();
Steema.TeeChart.Styles.Points Pinpoint = new Steema.TeeChart.Styles.Points();
TChart1.Series.Add(Pinpoint);
Pinpoint.Pointer.Visible = false;
Pinpoint.Pointer.InflateMargins = false;
Pinpoint.Pointer.Transparency = 100;
Pinpoint.Pointer.Pen.Visible = false;
Pinpoint.Marks.Color = Color.White;
Pinpoint.Marks.Pen.Color = Color.White;
Pinpoint.Marks.Shadow.Visible = false;
Pinpoint.Marks.Visible = true;
Steema.TeeChart.Axis axis = new Steema.TeeChart.Axis();
TChart1.Axes.Custom.Add(axis);
axis.StartPosition = 9;
axis.EndPosition = 9;
axis.Labels.Items.Add(0, " ");
axis.Labels.Items.Add(2000, " ");
axis.Labels.Items[0].Visible = false;
axis.Labels.Items[1].Visible = false;
axis.Title.Caption = "";
axis.Title.Font.Color = Color.Black;
TChart1.Series[0].CustomVertAxis = axis;
TChart1.Series[0].Clear();
if (dt_Point.Columns.Count == 0)
{
dt_Point.Columns.Add("SetTime", typeof(DateTime));
dt_Point.Columns.Add("Value", typeof(int));
dt_Point.Columns.Add("Label", typeof(string));
}
DataRow row;
row = dt_Point.NewRow();
row["SetTime"] = "2012-08-02 18:14:24";
row["Value"] = 100;
row["Label"] = "Point";
dt_Point.Rows.Add(row);
TChart1.Series[0].XValues.DataMember = "SetTime";
TChart1.Series[0].YValues.DataMember = "Value";
TChart1.Series[0].DataMember = "Label";
TChart1.Series[0].DataSource = dt_Point;
}
show the Graph :
I want to show graph:
I recommend that you set XValues.DateTime to true and change the DateTimeFormat and Style of the Bottom Axis labels to achieve the result that you want:
//XValues as DateTimeValues.
Pinpoint.XValues.DateTime = true;
//Labels axes style and format
tChart1.Axes.Bottom.Labels.DateTimeFormat = "hh:mm:ss";
tChart1.Axes.Bottom.Labels.Style = AxisLabelStyle.Value;

Categories

Resources