Skip to content

Instantly share code, notes, and snippets.

Avatar

Lohith lohithgn

View GitHub Profile
@lohithgn
lohithgn / series_setup.cs
Created Oct 27, 2016
setting series on the chart
View series_setup.cs
//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 Oct 27, 2016
set up Y Axis of the chart
View Y_Axis.cs
//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 Oct 27, 2016
Setting X Axis of the chart
View X_Axis.cs
//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 Oct 27, 2016
set the plot area of the chart
View plot_area.cs
//set up plot area
var plotArea = myChart.PlotArea;
plotArea.Appearance.FillStyle.BackgroundColor = Color.YellowGreen;
@lohithgn
lohithgn / chart_legend.cs
Created Oct 27, 2016
chart legend settings
View chart_legend.cs
//set up chart legend
var legend = myChart.Legend;
legend.Appearance.BackgroundColor = Color.White;
legend.Appearance.Position = ChartLegendPosition.Bottom;
@lohithgn
lohithgn / chart_title.cs
Created Oct 27, 2016
setting the chart title
View chart_title.cs
//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 Oct 27, 2016
chart appearance backgrund color
View chart_appearance.cs
myChart.Appearance.FillStyle.BackgroundColor = Color.LightGray;
@lohithgn
lohithgn / RadHtmlChart_CodeBehind.cs
Created Oct 27, 2016
page load handler for Default.aspx
View RadHtmlChart_CodeBehind.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadChart();
}
}
@lohithgn
lohithgn / RagHtmlChart_markup.aspx
Created Oct 27, 2016
Code Snippet for RadHtmlChart markup on a page
View RagHtmlChart_markup.aspx
<telerik:RadHtmlChart ID="myChart" runat="server"></telerik:RadHtmlChart>
@lohithgn
lohithgn / kuichartangular_seriesclick.js
Created Oct 3, 2016
kendo ui chart with angular - handling series click
View kuichartangular_seriesclick.js
$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);
}