I add two pointSeries:(2.739E-06,404521.65),(2.113E-05,5467.59) and a LineSeries that its points are (4.45E-08,404521.65),(4.45E-08,2.739E-06).There have Bottom axis and Left axis.All axes 's Logarithm is true,and AxisLabelStyle is Value. But the X-axis have two "0.00E+000" labels.Is this a Tchart's bug?I will highly appreciate your help. Thanks in Advance.
Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Steema.TeeChart;
using System.Drawing.Drawing2D;
using Steema.TeeChart.Styles;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private TChart _tChart = new Steema.TeeChart.TChart();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.Controls.Add(_tChart);
_tChart.Dock = DockStyle.Fill;
_tChart.Aspect.View3D = false;
_tChart.Panel.MarginBottom = 1;
_tChart.Panel.MarginLeft = 1;
_tChart.Panel.MarginRight = 5;
_tChart.Panel.MarginTop = 1;
_tChart.Walls.Back.Transparent = true;
//build pointSeries
string pointXYString = "2.739E-06,404521.65|2.113E-05,5467.59";
string[] pointValues = pointXYString.Split('|');
DataTable dt = new DataTable();
dt.Columns.Add("X", typeof(double));
dt.Columns.Add("Y", typeof(double));
for (int i = 0; i < pointValues.Length; i++)
{
string[] pointValue = pointValues[i].Split(',');
DataRow dr = dt.NewRow();
dr[0] = pointValue[0];
dr[1] = pointValue[1];
dt.Rows.Add(dr);
}
var points = new Points();
points.Title = "TestPointSeries";
points.Visible = true;
points.Marks.Text = "";
points.Pointer.Style = PointerStyles.Circle;
points.Pointer.Visible = true;
points.DataSource = dt;
points.ColorEach = true;
points.LabelMember = string.Empty;
points.XValues.DataMember = "X";
points.YValues.DataMember = "Y";
_tChart.Series.Add(points);
string lineXYString = "4.45E-08,404521.65|4.45E-08,2.739E-06";
string[] lineValues = lineXYString.Split('|');
DataTable dt2 = new DataTable();
dt2.Columns.Add("X", typeof(double));
dt2.Columns.Add("Y", typeof(double));
for (int i = 0; i < lineValues.Length; i++)
{
string[] lineValue = lineValues[i].Split(',');
DataRow dr = dt2.NewRow();
dr[0] = lineValue[0];
dr[1] = lineValue[1];
dt2.Rows.Add(dr);
}
var line = new Line();
line.Title = "TestLineSeries";
line.OutLine.Style = DashStyle.Solid;
line.Active = true;
line.Visible = true;
line.Pointer.Visible = true;
line.LinePen.Width = 4;
line.LinePen.Style = DashStyle.Custom;
line.Pointer.Style = PointerStyles.Nothing;
line.Color = Color.Red;
line.Marks.Text = string.Empty;
line.DataSource = dt2;
line.XValues.DataMember = "X";
line.YValues.DataMember = "Y";
_tChart.Series.Add(line);
//set Axes
_tChart.Axes.Bottom.Logarithmic = true;
_tChart.Axes.Bottom.LogarithmicBase = 10;
_tChart.Axes.Bottom.Automatic = true;
_tChart.Axes.Bottom.AutomaticMaximum = false;
_tChart.Axes.Bottom.AutomaticMinimum = false;
_tChart.Axes.Bottom.MinorTickCount = 9;
_tChart.Axes.Bottom.Labels.Style = AxisLabelStyle.Value;
_tChart.Axes.Bottom.Labels.ValueFormat = "#.000E+0000";
_tChart.Axes.Left.Logarithmic = true;
_tChart.Axes.Left.LogarithmicBase = 10;
_tChart.Axes.Left.Automatic = true;
_tChart.Axes.Left.AutomaticMaximum = false;
_tChart.Axes.Left.AutomaticMinimum = false;
_tChart.Axes.Left.MinorTickCount = 9;
_tChart.Axes.Left.Labels.Style = AxisLabelStyle.Value;
_tChart.Axes.Left.Labels.ValueFormat = "#.0000E+00";
}
}
}