本文整理汇总了C#中Visifire.Charts.Axis类的典型用法代码示例。如果您正苦于以下问题:C# Axis类的具体用法?C# Axis怎么用?C# Axis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Axis类属于Visifire.Charts命名空间,在下文中一共展示了Axis类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SolidColorBrush
SolidColorBrush twoSDBrush = new SolidColorBrush(Color.FromArgb(50,3, 3, 247)); //平均曲线颜色,红色
#endregion Fields
#region Constructors
public PageAvgCurve()
{
InitializeComponent();
chart1 = new Chart();
chart2 = new Chart();
chart2.ScrollingEnabled = chart1.ScrollingEnabled = false;
chart1.BorderThickness = chart2.BorderThickness = new Thickness(0, 0, 0, 0);
Axis yOACAxis = new Axis();
Axis yEACAxis = new Axis();
yOACAxis.Suffix = yEACAxis.Suffix = "(Nm)";
chart1.AxesY.Add(yOACAxis);
chart2.AxesY.Add(yEACAxis);
Axis xAxisOAC = new Axis();
Axis xAxisEAC = new Axis();
xAxisEAC.AxisMinimum = xAxisOAC.AxisMinimum = 0;
xAxisOAC.AxisMaximum = xAxisEAC.AxisMaximum = 100;
xAxisEAC.Suffix = xAxisOAC.Suffix = "%";
chart1.AxesX.Add(xAxisOAC);
chart2.AxesX.Add(xAxisEAC);
grid1.Children.Add(chart1);
grid2.Children.Add(chart2);
}
示例2: CreateChart
public Chart CreateChart(ChartInformation ci)
{
Chart m_chart = new Chart();
m_chart.BorderThickness = ci.m_BorderThickness;
m_chart.Theme = ci.m_Theme;
m_chart.View3D = ci.m_View3D;
Axis m_axisX = new Axis();
m_axisX.Title = ci.m_axisXTitle;
m_chart.AxesX.Add(m_axisX);
Axis m_asixY = new Axis();
m_asixY.Title = ci.m_axisYTitle;
m_asixY.Enabled = true;
m_asixY.StartFromZero = true;
m_asixY.AxisType = AxisTypes.Primary;
m_asixY.AxisMaximum = ci.m_axisYMaximum;
m_asixY.Interval = ci.m_axisYInterval;
m_chart.AxesY.Add(m_asixY);
for(int i = 0;i<ci.dsc.Count;i++)
{
DataSeries ds = new DataSeries();
ds.LegendText = ci.dsc[i].LegendText;
ds.RenderAs = ci.dsc[i].RenderAs;
ds.AxisYType = ci.dsc[i].AxisYType;
ds.DataPoints = new DataPointCollection(ci.dsc[i].DataPoints);
m_chart.Series.Add(ds);
}
m_chart.Rendered+=new EventHandler(chart_Rendered);
return m_chart;
}
示例3: LineThicknessDefaultValue
public void LineThicknessDefaultValue()
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
Common.CreateAndAddDefaultDataSeries(chart);
ChartGrid grid = new ChartGrid();
Axis axis = new Axis();
axis.Grids.Add(grid);
chart.AxesY.Add(axis);
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Window window = new Window();
window.Content = chart;
window.Show();
if (_isLoaded)
{
Assert.AreEqual(0.25, grid.LineThickness);
}
window.Dispatcher.InvokeShutdown();
window.Close();
}
示例4: Refresh
public void Refresh(object sender)
{
Layout.Children.Clear();
MultiChartControl.MultiChart MyChart = new MultiChartControl.MultiChart();
DashBoardGraphViewModel vm = (DashBoardGraphViewModel)sender;
MyChart.Series.Clear();
for (int i = 0; i < vm.Datos.Count; i++)
{
MyChart.Series.Add(c.GetSerie(DashBoardGraph)[i]);
}
MyChart.Style = (Style)FindResource("ChartStyle");
Axis a = new Axis();
a.ValueFormatString = "0%";
MyChart.AxesY.Add(a);
Layout.Children.Add(MyChart);
lblAnio.Content = AnioMesView.SelectedAnio.Anio;
lblMes.Content = AnioMesView.SelectedMes.MesName;
try
{
lblDireccion.Text = DashBoradTable.SelectedItem.Organigrama.JerarquiaName;
}
catch (Exception)
{
lblDireccion.Text = "OCAVM";
}
}
示例5: CheckDefaultLineThickness
public void CheckDefaultLineThickness()
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
Common.CreateAndAddDefaultDataSeries(chart);
Ticks tick = new Ticks();
Axis axis = new Axis();
axis.Ticks.Add(tick);
chart.AxesX.Add(axis);
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Window window = new Window();
window.Content = chart;
window.Show();
if (_isLoaded)
{
Assert.AreEqual(0.5, tick.LineThickness);
}
window.Dispatcher.InvokeShutdown();
window.Close();
}
示例6: CreateLcChartSpline
private void CreateLcChartSpline(int index)
{
//添加横坐标
if (lcChart.AxesX.Count == 0)
{
Axis xAxis = new Axis();
xAxis.Title = "岩层编号";
lcChart.AxesX.Add(xAxis);
}
//添加纵坐标
if (lcChart.AxesY.Count == 0)
{
Axis yAxis = new Axis();
yAxis.Title = LCDestOpt[index];
yAxis.IntervalType = IntervalTypes.Number;
yAxis.ValueFormatString = "f3";
yAxis.Suffix = "m";
lcChart.AxesY.Add(yAxis);
}
else
{
lcChart.AxesY[0].Title = LCDestOpt[index];
}
//设置数据点
lcDataSeries.DataPoints.Clear();
DataPoint dataPoint;
int drawCount = keyLayers.Count;
for (int i = 0; i < drawCount; i++)
{
//创建一个数据点的实例
dataPoint = new DataPoint();
//设置X轴点
dataPoint.AxisXLabel = keyLayers[i].ycbh.ToString();
dataPoint.XValue = i + 1;
//设置Y轴点
switch(index)
{
case 0:
dataPoint.YValue = keyLayers[i].yczdxcz;
break;
case 1:
dataPoint.YValue = keyLayers[i].jsdjscjwy;
break;
case 2:
dataPoint.YValue = keyLayers[i].jsdjslcwy;
break;
}
dataPoint.MarkerSize = 8;
dataPoint.MouseLeftButtonDown += new MouseButtonEventHandler(lcdataPoint_MouseLeftButtonDown);
//添加数据点
lcDataSeries.DataPoints.Add(dataPoint);
}
}
示例7: PlotGroup
/// <summary>
/// Initializes a new instance of the Visifire.Charts.PlotGroup class.
/// </summary>
/// <param name="renderAs">RenderAs</param>
/// <param name="axisX">axisX</param>
/// <param name="axisY">AxisY</param>
public PlotGroup(RenderAs renderAs, Axis axisX, Axis axisY)
{
DataSeriesList = new List<DataSeries>();
XWiseStackedDataList = new Dictionary<Double, XWiseStackedData>();
RenderAs = renderAs;
AxisX = axisX;
AxisY = axisY;
}
示例8: DataPointDecimalXValueChecking
public void DataPointDecimalXValueChecking()
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
Axis axisX = new Axis();
axisX.Interval = 1;
chart.AxesX.Add(axisX);
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Random rand = new Random();
DataSeries dataSeries1 = new DataSeries();
List<Double> xList = new List<Double>();
List<Double> yList = new List<Double>();
Double y = 0;
for (Double i = 0; i < 10; i++)
{
DataPoint dataPoint = new DataPoint();
dataPoint.XValue = i + 1;
xList.Add(i);
dataPoint.YValue = (y = rand.Next(-100, 100));
yList.Add(y);
dataSeries1.DataPoints.Add(dataPoint);
}
chart.Series.Add(dataSeries1);
DataSeries dataSeries2 = new DataSeries();
dataSeries2.RenderAs = RenderAs.Column;
Double j = 0.5;
for (Int32 i = 0; i < 10; i++)
{
DataPoint dataPoint = new DataPoint();
dataPoint.XValue = j;
dataPoint.YValue = yList[i];
dataSeries2.DataPoints.Add(dataPoint);
j++;
}
chart.Series.Add(dataSeries2);
Window window = new Window();
window.Content = chart;
window.Show();
if (_isLoaded)
{
window.Dispatcher.InvokeShutdown();
window.Close();
}
}
示例9: ColumnChartPerformanceTest
public void ColumnChartPerformanceTest()
{
Double totalDuration = 0;
DateTime start = DateTime.UtcNow;
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
chart.View3D = false;
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Axis axisX = new Axis();
axisX.Interval = 1;
chart.AxesX.Add(axisX);
Random rand = new Random();
Int32 numberOfSeries = 0;
DataSeries dataSeries = null;
Int32 numberofDataPoint = 0;
String msg = Common.AssertAverageDuration(100, 1, delegate
{
dataSeries = new DataSeries();
dataSeries.RenderAs = RenderAs.Column;
for (Int32 i = 0; i < 1000; i++)
{
DataPoint dataPoint = new DataPoint();
dataPoint.AxisXLabel = "a" + i;
dataPoint.YValue = rand.Next(-100, 100);
dataSeries.DataPoints.Add(dataPoint);
numberofDataPoint++;
}
numberOfSeries++;
chart.Series.Add(dataSeries);
});
window = new Window();
window.Content = chart;
window.Show();
if (_isLoaded)
{
DateTime end = DateTime.UtcNow;
totalDuration = (end - start).TotalSeconds;
MessageBox.Show("Total Chart Loading Time: " + totalDuration + "s" + "\n" + "Number of Render Count: " + chart.ChartArea._renderCount + "\n" + "Series Calculation: " + msg);
}
window.Dispatcher.InvokeShutdown();
}
示例10: WindowMain
/// <summary>
/// Show form
/// </summary>
public WindowMain()
{
InitializeComponent();
// Create Y axis
Axis yAxis = new Axis();
yAxis.AxisMaximum = 1;
yAxis.Title = "Probability";
chart.AxesY.Add(yAxis);
// Create X axis
Axis xAxis = new Axis();
//xAxis.AxisMaximum = 100;
xAxis.Title = "% (percent)";
chart.AxesX.Add(xAxis);
}
示例11: TestAxisDecimalIntervalWithAxisXLabel
public void TestAxisDecimalIntervalWithAxisXLabel()
{
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
_isLoaded = false;
chart.Loaded += new RoutedEventHandler(chart_Loaded);
Random rand = new Random();
TestPanel.Children.Add(chart);
EnqueueConditional(() => { return _isLoaded; });
EnqueueDelay(_sleepTime);
DataSeries dataSeries = new DataSeries();
dataSeries.RenderAs = RenderAs.Column;
for (Int32 i = 0; i < 10; i++)
dataSeries.DataPoints.Add(new DataPoint() { AxisXLabel = "Visifire", YValue = rand.Next(10, 100) });
chart.Series.Add(dataSeries);
EnqueueCallback(() =>
{
Axis axis = new Axis();
axis.Interval = 0.1;
chart.AxesX.Add(axis);
});
EnqueueDelay(_sleepTime);
EnqueueTestComplete();
}
示例12: TextWrapNewValue
public void TextWrapNewValue()
{
Chart chart = new Chart();
chart.Width = 400;
chart.Height = 300;
_axisX = new Axis();
_axisX.AxisLabels = new AxisLabels();
_axisX.AxisLabels.TextWrap = 0.5;
_axisX.AxisLabels.Angle = 0;
_axisX.Interval = 1;
_axisX.AxisLabels.Rows = 1;
chart.AxesX.Add(_axisX);
DataSeries dataSeries = new DataSeries();
dataSeries.RenderAs = RenderAs.Column;
Random rand = new Random();
for (Int32 i = 0; i < 5; i++)
{
DataPoint datapoint = new DataPoint();
datapoint.AxisXLabel = "VisifireSilverlight" + i;
datapoint.YValue = rand.Next(0, 100);
datapoint.XValue = i + 1;
dataSeries.DataPoints.Add(datapoint);
}
chart.Series.Add(dataSeries);
CreateAsyncTest(chart,
() => Assert.AreEqual(0.5, _axisX.AxisLabels.TextWrap, Common.HighPrecisionDelta));
EnqueueTestComplete();
}
示例13: CheckAxisLabelsAutoPlacement2
public void CheckAxisLabelsAutoPlacement2()
{
System.Windows.Browser.HtmlPage.Plugin.SetStyleAttribute("height", "400px");
Chart chart = new Chart();
chart.Width = 500;
chart.Height = 300;
chart.ScrollingEnabled = false;
chart.Loaded += new System.Windows.RoutedEventHandler(chart_Loaded);
TestPanel.Children.Add(chart);
Axis axisX = new Axis();
axisX.AxisLabels = new AxisLabels();
axisX.AxisLabels.FontColor = new SolidColorBrush(Colors.Red);
chart.AxesX.Add(axisX);
DataSeries dataSeries = new DataSeries();
dataSeries.RenderAs = RenderAs.Line;
Random rand = new Random();
Int32 numberOfDataPoint = 0;
Double totalDuration = 0;
DateTime start = DateTime.UtcNow;
String msg = Common.AssertAverageDuration(80, 1, delegate
{
for (Int32 i = 0; i < 500; i++)
{
DataPoint datapoint = new DataPoint();
datapoint.AxisXLabel = "Visifire Label" + i;
datapoint.YValue = rand.Next(0, 100);
dataSeries.DataPoints.Add(datapoint);
numberOfDataPoint++;
}
chart.Series.Add(dataSeries);
});
EnqueueConditional(() => { return _isLoaded; });
EnqueueCallback(() =>
{
DateTime end = DateTime.UtcNow;
totalDuration = (end - start).TotalSeconds;
});
EnqueueCallback(() =>
{
_htmlElement1 = Common.GetDisplayMessageButton(_htmlElement1);
_htmlElement1.SetStyleAttribute("width", "900px");
_htmlElement1.SetProperty("value", numberOfDataPoint + " AxisLabels are added. Click here to exit.");
_htmlElement2 = Common.GetDisplayMessageButton(_htmlElement2);
_htmlElement2.SetStyleAttribute("top", "540px");
_htmlElement2.SetProperty("value", msg + " Total Chart Loading Time: " + totalDuration + "s");
System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement1);
System.Windows.Browser.HtmlPage.Document.Body.AppendChild(_htmlElement2);
});
EnqueueCallback(() =>
{
_htmlElement1.AttachEvent("onclick", new EventHandler<System.Windows.Browser.HtmlEventArgs>(this.HtmlElement_OnClick));
});
}
示例14: FontWeightNewValue
public void FontWeightNewValue()
{
Chart chart = new Chart();
chart.Width = 400;
chart.Height = 300;
_axisX = new Axis();
_axisY = new Axis();
_axisX.AxisLabels = new AxisLabels();
_axisY.AxisLabels = new AxisLabels();
_axisX.AxisLabels.FontWeight = FontWeights.Bold;
_axisY.AxisLabels.FontWeight = FontWeights.Bold;
chart.AxesX.Add(_axisX);
chart.AxesY.Add(_axisY);
Common.CreateAndAddDefaultDataSeries(chart);
EnqueueDelay(_sleepTime);
CreateAsyncTask(chart,
() => Assert.AreEqual(FontWeights.Bold, _axisX.AxisLabels.FontWeight),
() => Assert.AreEqual(FontWeights.Bold, _axisY.AxisLabels.FontWeight));
EnqueueTestComplete();
}
示例15: RowsNewValue
public void RowsNewValue()
{
Chart chart = new Chart();
chart.Width = 400;
chart.Height = 300;
_axisX = new Axis();
_axisX.AxisLabels = new AxisLabels();
_axisX.AxisLabels.Rows = 2;
chart.AxesX.Add(_axisX);
Common.CreateAndAddDefaultDataSeries(chart);
EnqueueDelay(_sleepTime);
CreateAsyncTest(chart,
() => Assert.AreEqual(2, _axisX.AxisLabels.Rows));
EnqueueTestComplete();
}