Visfire 4.0.0 beta
http://www.downloadatlas.com/get/soft-38a55a3a.html
Hi aguirretech,
Please try the code below
Please try the code below
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Visifire.Charts;
using Visifire.Commons;
using System.Globalization;
using System.Threading;
namespace Simple
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
CultureInfo oldCi = Thread.CurrentThread.CurrentCulture;
CultureInfo oldUCi = Thread.CurrentThread.CurrentUICulture;
SetCurrentCulture("da-DK");
CreateChart();
chart.Rendered += delegate
{
SetCurrentCulture("en-GB");
CreateChart();
chart.Rendered += delegate
{
SetCurrentCulture("da-DK");
CreateChart();
chart.Rendered += delegate
{
Thread.CurrentThread.CurrentCulture = oldCi;
Thread.CurrentThread.CurrentUICulture = oldUCi;
};
};
};
}
private void SetCurrentCulture(String cultureCode)
{
CultureInfo ci = new CultureInfo(cultureCode);
Thread.CurrentThread.CurrentCulture = ci;
Thread.CurrentThread.CurrentUICulture = ci;
}
Chart chart;
/// <summary>
/// Function to create a chart
/// </summary>
public void CreateChart()
{
// Create a new instance of Chart
chart = new Chart();
// Set the chart width and height
chart.Width = 500;
chart.Height = 200;
Axis yAxis = new Axis() { ValueFormatString = "#0.00000##" };
chart.AxesY.Add(yAxis);
// Create a new instance of Title
Title title = new Title();
// Set title property
title.Text = "Visifire Sample Chart";
// Add title to Titles collection
chart.Titles.Add(title);
// Create a new instance of DataSeries
DataSeries dataSeries = new DataSeries() { YValueFormatString = "##.#####" };
// Set DataSeries property
dataSeries.RenderAs = RenderAs.Column;
// Create a DataPoint
DataPoint dataPoint;
for (int i = 0; i < 5; i++)
{
// Create a new instance of DataPoint
dataPoint = new DataPoint();
// Set YValue for a DataPoint
dataPoint.YValue = rand.Next(10, 100)*0.12345;
// Add dataPoint to DataPoints collection
dataSeries.DataPoints.Add(dataPoint);
}
// Add dataSeries to Series collection.
chart.Series.Add(dataSeries);
// Add chart to LayoutRoot
MyStackPanel.Children.Add(chart);
}
/// <summary>
/// Create a random class variable
/// </summary>
Random rand = new Random(DateTime.Now.Millisecond);
}
}
'심심풀이 개발' 카테고리의 다른 글
C# 정규표현식 (0) | 2011.02.24 |
---|---|
WPF Panel 공부 (0) | 2011.02.18 |
Mysql 한글 설정 (0) | 2011.02.08 |
VS2010 리본(Ribbon)메뉴 컴포넌트 (0) | 2011.01.27 |
Windows7 64bit mysql (0) | 2010.12.03 |