Gallery
JS Customer Satisfaction Chart
<%@ Page Language="C#" Description="dotnetCHARTING Component"%>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<script runat="server">
void Page_Load(Object sender,EventArgs e)
{
// Demonstrates a A line chart used to illustrate a concept.
// Set he chart size.
Chart.Width = 400;
Chart.Height = 400;
// Set the directory where the related JSC files will be created and stored.
Chart.TempDirectory="temp";
// Enable JSCharting
Chart.JS.Enabled = true;
// Set the default series type.
Chart.DefaultSeries.Type = SeriesType.Spline;
Chart.DefaultSeries.Line.Width = 3;
Chart.DefaultElement.Marker.Visible = false;
Chart.LegendBox.Visible = false;
Chart.ChartArea.ClearColors();
Chart.Palette = new Color[] { ColorTranslator.FromHtml("#4eace2"), ColorTranslator.FromHtml("#83b82d"), ColorTranslator.FromHtml("#2360a0")};
Chart.Debug = false;
Chart.DefaultElement.ToolTip = "";
Chart.JS.Settings.Add("defaultSeries.mouseTracking_enabled", "false");
// Set the x axis label
Chart.XAxis.Label.Text="Product Function";
Chart.XAxis.ScaleRange.ValueLow = 0;
Chart.XAxis.ScaleRange.ValueHigh = 10;
AxisTick ax = new AxisTick(0, "Absent");
ax.Line.Length = 0;
ax.Label.Offset = new Point(0, 2);
Chart.XAxis.ExtraTicks.Add(ax);
ax = new AxisTick(10, "Fully<br>Implemented");
ax.Line.Length = 0;
Chart.XAxis.ExtraTicks.Add(ax);
Chart.XAxis.Line.EndCap = LineCap.ArrowAnchor;
Chart.XAxis.Line.AnchorCapScale = 3;
Chart.XAxis.Line.Width = 3;
Chart.XAxis.DefaultTick.Value = "";
// Set the y axis label
Chart.YAxis.Label.Text="Customer Satisfaction";
Chart.YAxis.ScaleRange.ValueLow = 0;
Chart.YAxis.ScaleRange.ValueHigh = 10;
AxisTick at = new AxisTick(0, "Low");
at.Line.Length = 0;
at.Label.Offset = new Point(-3, 0);
Chart.YAxis.ExtraTicks.Add(at);
at = new AxisTick(10, "High");
at.Line.Length = 0;
Chart.YAxis.ExtraTicks.Add(at);
Chart.YAxis.Line.EndCap = LineCap.ArrowAnchor;
Chart.YAxis.Line.AnchorCapScale = 3;
Chart.YAxis.Line.Width = 3;
Chart.YAxis.DefaultTick.Value = "";
// Add the random data.
Chart.SeriesCollection.Add(getData());
}
SeriesCollection getData()
{
SeriesCollection sc = new SeriesCollection();
Series excitement = new Series("Excitement<br>Attributes");
Element e1 = new Element();
e1.XValue = 1;
e1.YValue = 5.6;
excitement.Elements.Add(e1);
e1 = new Element();
e1.XValue = 3.9;
e1.YValue = 6.9;
excitement.Elements.Add(e1);
e1 = new Element();
e1.XValue = 5.3;
e1.YValue = 9.5;
e1.SmartLabel.Text = "%SeriesName";
e1.ShowValue = true;
excitement.Elements.Add(e1);
Series performance = new Series("Performance<br>Attributes");
e1 = new Element();
e1.XValue = 1.5;
e1.YValue = 1.6;
performance.Elements.Add(e1);
e1 = new Element();
e1.XValue = 8.2;
e1.YValue =8.9;
e1.SmartLabel.Text = "%SeriesName";
e1.ShowValue = true;
performance.Elements.Add(e1);
Series threshold = new Series("Threshold<br>Attributes");
e1 = new Element();
e1.XValue = 2.5;
e1.YValue = 0.6;
threshold.Elements.Add(e1);
e1 = new Element();
e1.XValue = 5.9;
e1.YValue = 3.3;
threshold.Elements.Add(e1);
e1 = new Element();
e1.XValue = 10;
e1.YValue = 4.2;
e1.SmartLabel.Text = "%SeriesName";
e1.ShowValue = true;
threshold.Elements.Add(e1);
sc.Add(excitement, performance,threshold);
return sc;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Gallery Sample</title></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" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
' Demonstrates a A line chart used to illustrate a concept.
' Set he chart size.
Chart.Width = 400
Chart.Height = 400
' Set the directory where the related JSC files will be created and stored.
Chart.TempDirectory="temp"
' Enable JSCharting
Chart.JS.Enabled = True
' Set the default series type.
Chart.DefaultSeries.Type = SeriesType.Spline
Chart.DefaultSeries.Line.Width = 3
Chart.DefaultElement.Marker.Visible = False
Chart.LegendBox.Visible = False
Chart.ChartArea.ClearColors()
Chart.Palette = New Color() { ColorTranslator.FromHtml("#4eace2"), ColorTranslator.FromHtml("#83b82d"), ColorTranslator.FromHtml("#2360a0")}
Chart.Debug = False
Chart.DefaultElement.ToolTip = ""
Chart.JS.Settings.Add("defaultSeries.mouseTracking_enabled", "false")
' Set the x axis label
Chart.XAxis.Label.Text="Product Function"
Chart.XAxis.ScaleRange.ValueLow = 0
Chart.XAxis.ScaleRange.ValueHigh = 10
Dim ax As AxisTick = New AxisTick(0, "Absent")
ax.Line.Length = 0
ax.Label.Offset = New Point(0, 2)
Chart.XAxis.ExtraTicks.Add(ax)
ax = New AxisTick(10, "Fully<br>Implemented")
ax.Line.Length = 0
Chart.XAxis.ExtraTicks.Add(ax)
Chart.XAxis.Line.EndCap = LineCap.ArrowAnchor
Chart.XAxis.Line.AnchorCapScale = 3
Chart.XAxis.Line.Width = 3
Chart.XAxis.DefaultTick.Value = ""
' Set the y axis label
Chart.YAxis.Label.Text="Customer Satisfaction"
Chart.YAxis.ScaleRange.ValueLow = 0
Chart.YAxis.ScaleRange.ValueHigh = 10
Dim at As AxisTick = New AxisTick(0, "Low")
at.Line.Length = 0
at.Label.Offset = New Point(-3, 0)
Chart.YAxis.ExtraTicks.Add(at)
at = New AxisTick(10, "High")
at.Line.Length = 0
Chart.YAxis.ExtraTicks.Add(at)
Chart.YAxis.Line.EndCap = LineCap.ArrowAnchor
Chart.YAxis.Line.AnchorCapScale = 3
Chart.YAxis.Line.Width = 3
Chart.YAxis.DefaultTick.Value = ""
' Add the random data.
Chart.SeriesCollection.Add(getData())
End Sub
Function getData() As SeriesCollection
Dim sc As SeriesCollection = New SeriesCollection()
Dim excitement As Series = New Series("Excitement<br>Attributes")
Dim e1 As Element = New Element()
e1.XValue = 1
e1.YValue = 5.6
excitement.Elements.Add(e1)
e1 = New Element()
e1.XValue = 3.9
e1.YValue = 6.9
excitement.Elements.Add(e1)
e1 = New Element()
e1.XValue = 5.3
e1.YValue = 9.5
e1.SmartLabel.Text = "%SeriesName"
e1.ShowValue = True
excitement.Elements.Add(e1)
Dim performance As Series = New Series("Performance<br>Attributes")
e1 = New Element()
e1.XValue = 1.5
e1.YValue = 1.6
performance.Elements.Add(e1)
e1 = New Element()
e1.XValue = 8.2
e1.YValue =8.9
e1.SmartLabel.Text = "%SeriesName"
e1.ShowValue = True
performance.Elements.Add(e1)
Dim threshold As Series = New Series("Threshold<br>Attributes")
e1 = New Element()
e1.XValue = 2.5
e1.YValue = 0.6
threshold.Elements.Add(e1)
e1 = New Element()
e1.XValue = 5.9
e1.YValue = 3.3
threshold.Elements.Add(e1)
e1 = New Element()
e1.XValue = 10
e1.YValue = 4.2
e1.SmartLabel.Text = "%SeriesName"
e1.ShowValue = True
threshold.Elements.Add(e1)
sc.Add(excitement, performance,threshold)
Return sc
End Function
</script>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Gallery Sample</title></head>
<body>
<div align="center">
<dotnet:Chart id="Chart" runat="server"/>
</div>
</body>
</html>
- Sample FilenameJsCustomerSatisfactionChart.aspx
- Version10.0
- Uses DatabaseNo