Gallery
<%@ Page Language="C#" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
// Demonstrates RTL language support.
Chart.Type = ChartType.Combo;
Chart.DefaultCultureName = "he-IL";
Chart.Width = 740;
Chart.Height = 400;
Chart.TempDirectory = "temp";
Chart.Debug = false;
Chart.DefaultSeries.Type = SeriesType.Line;
Chart.DefaultElement.Marker.Size = 10;
Chart.JS.Enabled = true;
Chart.XAxis.Crosshair = new AxisTick();
Chart.ToolTipTemplate = "<b>%xValue</b><br>%points";
Chart.JS.Settings.Add("defaultSeries.defaultPoint_marker_fill", "white");
Chart.DefaultSeries.FirstElement.ShowValue = true;
Chart.DefaultSeries.FirstElement.SmartLabel.Text = "<b>%seriesName</b>";
Chart.TitleBox.Label.Text = "טעסט טשאַרט";
Chart.TitleBox.Position = TitleBoxPosition.Center;
Chart.TitleBox.Label.Font = new Font("Balance", 30);
Chart.LegendBox.Template = "%sum %icon %name";
// *DYNAMIC DATA NOTE*
// This sample uses random data to populate the chart. To populate
// a chart with database data see the following resources:
// - Classic samples folder
// - Help File > Data Tutorials
// - Sample: features/DataEngine.aspx
SeriesCollection mySC = getRandomData();
Chart.XAxis.Label.Text = "אַקס כעדער";
Chart.XAxis.Label.Font = new Font("Balance", 20);
Chart.XAxis.Scale = Scale.Time;
AxisTick month = new AxisTick();
month.Label.Text = "{%min:date MMM}";
month.Label.LineAlignment = StringAlignment.Far;
Chart.JS.Settings.Add("xAxis.customTicks.0.value_pattern", "month");
Chart.JS.Settings.Add("xAxis.customTicks.0.rangeMode", "curly");
Chart.XAxis.ExtraTicks.Add(month);
AxisTick year = new AxisTick();
year.Label.Text = "%min";
year.Line.StartCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
Chart.XAxis.ExtraTicks.Add(year);
Chart.JS.Settings.Add("xAxis.customTicks.1.value_pattern", "year");
Chart.YAxis.Label.Text = "אַקס כעדער";
Chart.XAxis.Label.Font = new Font("Balance", 20);
Chart.YAxis.Orientation = dotnetCHARTING.Orientation.Right;
Chart.YAxis.FormatString = "c";
// Add the random data.
Chart.SeriesCollection.Add(mySC);
}
SeriesCollection getRandomData()
{
SeriesCollection SC = new SeriesCollection();
Random myR = new Random(2);
DateTime dt = new DateTime(2019, 12, 1);
Series s = new Series();
s.DefaultElement.Marker.Type = ElementMarkerType.Circle;
s.Name = "בדיקה";
for (int b = 1; b < 9; b++)
{
Element e = new Element();
e.YValue = myR.Next(40, 80);
e.XDateTime = dt = dt.AddMonths(1);
s.Elements.Add(e);
}
SC.Add(s);
myR = new Random(3);
dt = new DateTime(2019, 12, 1);
s = new Series();
s.DefaultElement.Marker.Type = ElementMarkerType.Circle;
s.Name = "בדיקה2";
for (int b = 1; b < 9; b++)
{
Element e = new Element();
e.YValue = myR.Next(40, 80);
e.XDateTime = dt = dt.AddMonths(1);
s.Elements.Add(e);
}
SC.Add(s);
return SC;
}
</script>
</head>
<body>
<div align="center">
<dotnet:Chart ID="Chart" runat="server" />
</div>
</body>
</html>
<%@ Page Language="vb" Description="dotnetCHARTING Component" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING" %>
<%@ Import Namespace="System.Drawing" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
' Demonstrates RTL language support.
Chart.Type = ChartType.Combo
Chart.DefaultCultureName = "he-IL"
Chart.Width = 740
Chart.Height = 400
Chart.TempDirectory = "temp"
Chart.Debug = False
Chart.DefaultSeries.Type = SeriesType.Line
Chart.DefaultElement.Marker.Size = 10
Chart.JS.Enabled = True
Chart.XAxis.Crosshair = New AxisTick()
Chart.ToolTipTemplate = "<b>%xValue</b><br>%points"
Chart.JS.Settings.Add("defaultSeries.defaultPoint_marker_fill", "white")
Chart.DefaultSeries.FirstElement.ShowValue = True
Chart.DefaultSeries.FirstElement.SmartLabel.Text = "<b>%seriesName</b>"
Chart.TitleBox.Label.Text = "???? ??????"
Chart.TitleBox.Position = TitleBoxPosition.Center
Chart.TitleBox.Label.Font = New Font("Balance", 30)
Chart.LegendBox.Template = "%sum %icon %name"
' *DYNAMIC DATA NOTE*
' This sample uses random data to populate the chart. To populate
' a chart with database data see the following resources:
' - Classic samples folder
' - Help File > Data Tutorials
' - Sample: features/DataEngine.aspx
Dim mySC As SeriesCollection = getRandomData()
Chart.XAxis.Label.Text = "???? ?????"
Chart.XAxis.Label.Font = New Font("Balance", 20)
Chart.XAxis.Scale = Scale.Time
Dim month As AxisTick = New AxisTick()
month.Label.Text = "{%min:date MMM}"
month.Label.LineAlignment = StringAlignment.Far
Chart.JS.Settings.Add("xAxis.customTicks.0.value_pattern", "month")
Chart.JS.Settings.Add("xAxis.customTicks.0.rangeMode", "curly")
Chart.XAxis.ExtraTicks.Add(month)
Dim year As AxisTick = New AxisTick()
year.Label.Text = "%min"
year.Line.StartCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor
Chart.XAxis.ExtraTicks.Add(year)
Chart.JS.Settings.Add("xAxis.customTicks.1.value_pattern", "year")
Chart.YAxis.Label.Text = "???? ?????"
Chart.XAxis.Label.Font = New Font("Balance", 20)
Chart.YAxis.Orientation = dotnetCHARTING.Orientation.Right
Chart.YAxis.FormatString = "c"
' Add the random data.
Chart.SeriesCollection.Add(mySC)
End Sub
Function getRandomData() As SeriesCollection
Dim SC As SeriesCollection = New SeriesCollection()
Dim myR As Random = New Random(2)
Dim dt As DateTime = New DateTime(2019, 12, 1)
Dim s As Series = New Series()
s.DefaultElement.Marker.Type = ElementMarkerType.Circle
s.Name = "?????"
For b As Integer = 1 To 8
Dim e As Element = New Element()
e.YValue = myR.Next(40, 80)
dt = dt.AddMonths(1)
e.XDateTime = dt
s.Elements.Add(e)
Next b
SC.Add(s)
myR = New Random(3)
dt = New DateTime(2019, 12, 1)
s = New Series()
s.DefaultElement.Marker.Type = ElementMarkerType.Circle
s.Name = "?????2"
For b As Integer = 1 To 8
Dim e As Element = New Element()
e.YValue = myR.Next(40, 80)
dt = dt.AddMonths(1)
e.XDateTime = dt
s.Elements.Add(e)
Next b
SC.Add(s)
Return SC
End Function
</script>
</head>
<body>
<div align="center">
<dotnet:Chart ID="Chart" runat="server" />
</div>
</body>
</html>
- Sample FilenameJsRtltext.aspx
- Version10.1
- Uses DatabaseNo