Archivo de la etiqueta: Desarrollo Web

Formatos Axisx o y en MS Chart 4.0

How do I use ChartValueType.Time on the XAxis of a line chart?

Hi

I’m trying to draw a FastLine graph where the points are all really (TimeSpan timeSinceStart,  double value).

Because the graph won’t bind to TimeSpan I’ve used DateTime instead – with all x values relative to DateTime(1900,1,1)  – is this the correct thing to do?

However, when I plot the series it refuses to put “sensible” values in for the Minimum on the XAxis – how should this be setup? I’ve also tried using IsStartedFromZero – is this any use?

Some snippets of my code (if that helps)

            ChartArea area = new ChartArea(chartAreaName);
area.AxisX.IsLabelAutoFit = false;
//area.AxisX.IsStartedFromZero = true;
//area.AxisX.Minimum = 0.0;
//area.AxisX.Minimum = ChartPoint.BaseTime.;
area.AxisX.LabelStyle.Format = “hh:mm:ss”; //”N0″;
area.AxisX.IntervalType = DateTimeIntervalType.Hours;
area.AxisY.IsLabelAutoFit = false;
Chart1.ChartAreas.Add(area);

Series speedSeries = new Series(chartName);
speedSeries.Points.DataBind(items, xProperty, yProperty, string.Empty);
speedSeries.ChartType = SeriesChartType.FastLine;
speedSeries.ChartArea = chartAreaName;
speedSeries.XValueType = ChartValueType.Time;
Chart1.Series.Add(speedSeries);


Stuart

Fuente Original: https://social.msdn.microsoft.com

Eventos de paginación

El control GridView desencadena dos eventos cuando se desplaza a una nueva página de datos. El evento PageIndexChanging se produce antes de que el control GridView realice la operación de paginación. El evento PageIndexChanged se produce después de que se ha devuelto una nueva página de datos al control GridView.

Puede utilizar el evento PageIndexChanging para cancelar la operación de paginación, si es necesario, o realizar una tarea antes de que el control GridView solicite una nueva página de datos. Puede utilizar el evento PageIndexChanged para realizar una tarea después de que el usuario se desplace a una página de datos diferente.

Manejo de Microsoft Chart Controls ASP.NET

Introduction

The Microsoft Chart Controls provide ASP.NET developers with an API and a Web control for creating and displaying charts in a web page. Behind the scenes, the Microsoft Chart Controls take the data to be plotted and dynamically generates an image. This image can be generated using one of three techniques: the Chart Web control can generate the image and save it to the web server’s file system in a specified location; the Chart control can generate the image and store it in memory, session, or elsewhere, and have that image served by a built-in HTTP Handler, ChartHttpHandler; or the Chart control can send back the binary contents of the chart image directly to the browser. The chart image can be rendered using one of four image types: PNG, JPG, BMP, or EMF. And when rendering a JPG you can specify its compression level.

Fuente Original: ArticuloOficial

Otras Fuentes: Foro Microsoft

Solucionando error ‘Invalid temp directory’ de los ASP.NET Chart Control

Como crear postback en javascript

My situation is that, for some reasons, I just can use a HTML image control but want to have a postback function.
What I can think is to call a javascript function during the onclick of the HTML image control, then the javascript function to postback to server side with an argument.

However, I don’t have any idea on how to postback to server side in javascript with an argument for my case.

Ver articulo original para crear el Postback