Gallery
JS Finance Pattern Breaks
<%@ Page Language="C#" Description="dotnetCHARTING Component"%>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>
<script runat="server">
void Page_Load(Object sender,EventArgs e)
{
// Demonstrates a finance candlestick chart.
chart.JS.Enabled = true;
// Set the title.
chart.Title="Financial Chart";
// Set the financial chart type
chart.DefaultSeries.Type = SeriesTypeFinancial.CandleStick;
// Set the legend template
chart.LegendBox.Visible = false;
// Set the directory where the images will be stored.
chart.TempDirectory="temp";
// Set the format
chart.XAxis.FormatString = "d";
// Set the time padding for the x axis.
chart.XAxis.TimePadding = new TimeSpan(5,0,0,0);
// Set he chart size.
chart.Width = 700;
chart.Height = 350;
chart.JS.Settings.Add("xAxis.scale.defaultBreak.type", "hidden");
chart.JS.Settings.Add("xAxis.scale.breaks", "js:[]");
chart.JS.Settings.Add("xAxis.scale.breaks.0.weekday", "js:[0,6]");
chart.JS.Settings.Add("xAxis.scale.breaks.0.offset.unit", "day");
chart.JS.Settings.Add("xAxis.scale.breaks.0.offset.multiplier", "-.5");
chart.Palette = new Color[] { };//prevent setting Palette, use default JS Palette
//set data
DataEngine de = new DataEngine();
de.Data = "~/data/resources/snp6mo.csv";
de.DataFields = "Xvalue=Date,Open=Open,Close=Adj Close,High=High,Low=Low";
chart.SeriesCollection.Add(de.GetFinancialSeries());
}
</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" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
' Demonstrates a finance candlestick chart.
chart.JS.Enabled = True
' Set the title.
chart.Title="Financial Chart"
' Set the financial chart type
chart.DefaultSeries.Type = SeriesTypeFinancial.CandleStick
' Set the legend template
chart.LegendBox.Visible = False
' Set the directory where the images will be stored.
chart.TempDirectory="temp"
' Set the format
chart.XAxis.FormatString = "d"
' Set the time padding for the x axis.
chart.XAxis.TimePadding = New TimeSpan(5,0,0,0)
' Set he chart size.
chart.Width = 700
chart.Height = 350
chart.JS.Settings.Add("xAxis.scale.defaultBreak.type", "hidden")
chart.JS.Settings.Add("xAxis.scale.breaks", "js:[]")
chart.JS.Settings.Add("xAxis.scale.breaks.0.weekday", "js:[0,6]")
chart.JS.Settings.Add("xAxis.scale.breaks.0.offset.unit", "day")
chart.JS.Settings.Add("xAxis.scale.breaks.0.offset.multiplier", "-.5")
chart.Palette = New Color() { } 'prevent setting Palette, use default JS Palette
'set data
Dim de As DataEngine = New DataEngine()
de.Data = "~/data/resources/snp6mo.csv"
de.DataFields = "Xvalue=Date,Open=Open,Close=Adj Close,High=High,Low=Low"
chart.SeriesCollection.Add(de.GetFinancialSeries())
End Sub
</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 FilenameJsFinancePatternBreaks.aspx
- Version9.2
- Uses DatabaseNo