Skip to content

Instantly share code, notes, and snippets.

View lohithgn's full-sized avatar

Lohith lohithgn

View GitHub Profile
@lohithgn
lohithgn / series_setup.cs
Created October 27, 2016 07:49
setting series on the chart
//set up series
var series = plotArea.Series;
var barSeries = new ColumnSeries();
barSeries.Name = "Week 1";
barSeries.Items.AddRange(new List<SeriesItem>
{
new SeriesItem(35),
new SeriesItem(52),
new SeriesItem(18),
new SeriesItem(39),
@lohithgn
lohithgn / Y_Axis.cs
Created October 27, 2016 07:47
set up Y Axis of the chart
//set up y-axis
var yAxis = plotArea.YAxis;
yAxis.Color = Color.Black;
yAxis.MajorTickSize = 1;
yAxis.MajorTickType = TickType.Outside;
yAxis.MinorTickSize = 1;
yAxis.MinorTickType = TickType.Outside;
yAxis.MaxValue = 100;
yAxis.MinValue = 0;
yAxis.Step = 25;
@lohithgn
lohithgn / X_Axis.cs
Last active October 27, 2016 07:45
Setting X Axis of the chart
//set up x-axis
var xAxis = plotArea.XAxis;
xAxis.AxisCrossingValue = 0;
xAxis.Color = Color.Black;
xAxis.MajorTickType = TickType.Outside;
xAxis.MinorTickType = TickType.None;
xAxis.Reversed = false;
var axisItemCollection = xAxis.Items;
axisItemCollection.AddRange(new List<AxisItem>()
{
@lohithgn
lohithgn / plot_area.cs
Created October 27, 2016 07:42
set the plot area of the chart
//set up plot area
var plotArea = myChart.PlotArea;
plotArea.Appearance.FillStyle.BackgroundColor = Color.YellowGreen;
@lohithgn
lohithgn / chart_legend.cs
Created October 27, 2016 07:38
chart legend settings
//set up chart legend
var legend = myChart.Legend;
legend.Appearance.BackgroundColor = Color.White;
legend.Appearance.Position = ChartLegendPosition.Bottom;
@lohithgn
lohithgn / chart_title.cs
Created October 27, 2016 06:42
setting the chart title
//set up chart title
var chartTitle = myChart.ChartTitle;
chartTitle.Text = "Server CPU Load by Days";
chartTitle.Appearance.Align = ChartTitleAlign.Center;
chartTitle.Appearance.BackgroundColor = Color.White;
chartTitle.Appearance.Position = ChartTitlePosition.Top;
@lohithgn
lohithgn / chart_appearance.cs
Created October 27, 2016 06:35
chart appearance backgrund color
myChart.Appearance.FillStyle.BackgroundColor = Color.LightGray;
@lohithgn
lohithgn / RadHtmlChart_CodeBehind.cs
Created October 27, 2016 06:08
page load handler for Default.aspx
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadChart();
}
}
@lohithgn
lohithgn / RagHtmlChart_markup.aspx
Created October 27, 2016 06:05
Code Snippet for RadHtmlChart markup on a page
<telerik:RadHtmlChart ID="myChart" runat="server"></telerik:RadHtmlChart>
@lohithgn
lohithgn / kuichartangular_seriesclick.js
Created October 3, 2016 04:56
kendo ui chart with angular - handling series click
$scope.onSeriesClick = function(e){
var categorySelected = e.category;
if(categorySelected === "MSIE")
{
$scope.chartDataSource.data($scope.msieData);
}
else if(categorySelected === "Firefox")
{
$scope.chartDataSource.data($scope.ffData);
}