Importing .ten in Web Charts causes Custom Axes to dissapear
Posted: Fri Mar 16, 2012 3:18 pm
Good morning,
We currently have an application that generate a .ten from a Chart we use in our WinForm application. We have a little homemade Asp.Net application and we want to show the same Chart on it.
Unfortunately, when we Import the file, all of our custom axes are invisible.
We do not have that problem if we import the same file in the WinForm App. Would you know how to fix this problem?
It is now allowing me to upload one of the file I'm having trouble with, how can I provide you with one of my file?
Here is how I load it with Asp.NET
Page Load:
Chart Load:
We currently have an application that generate a .ten from a Chart we use in our WinForm application. We have a little homemade Asp.Net application and we want to show the same Chart on it.
Unfortunately, when we Import the file, all of our custom axes are invisible.
We do not have that problem if we import the same file in the WinForm App. Would you know how to fix this problem?
It is now allowing me to upload one of the file I'm having trouble with, how can I provide you with one of my file?
Here is how I load it with Asp.NET
Page Load:
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
//Crée notre Memory Stream
try
{
MemoryStream ms = new MemoryStream(ApplicationHost.Instance.StreamChartProd);
//Load le chart crée par le serveur
ChartProd.Chart.Import.Template.Load(ms);
}
catch (IOException ex)
{
Server.Transfer("~/ErrorPages/MiseAJourEnCours.aspx");
}
}
Code: Select all
protected void ChartProd_Load(object sender, EventArgs e)
{
//Vue qu'on importe le graphique, on doit rajouter les tools manuellement.
Steema.TeeChart.Chart chart = ChartProd.Chart;
Steema.TeeChart.Tools.ScrollTool scrollTool = new Steema.TeeChart.Tools.ScrollTool(chart);
Steema.TeeChart.Tools.SeriesHotspot hotspot = new Steema.TeeChart.Tools.SeriesHotspot();
//Permet d'afficher le tooltip custom
hotspot.GetHTMLMap += new Steema.TeeChart.Tools.SeriesHotspotEventHandler(tooltip_GetHTMLMap);
hotspot.MapAction = Steema.TeeChart.Styles.MapAction.Script;
chart.Tools.Add(hotspot);
//Le chart importer à juste une vision de 24 heures, nous on veut tout!
chart.Axes.Bottom.Minimum = DateTime.Now.AddHours(-25).ToOADate();
chart.Axes.Bottom.Maximum = DateTime.Now.AddHours(37).ToOADate();
//On va changer le background color du Chart.
chart.Panel.Color = System.Drawing.Color.White;
chart.Panel.Gradient.StartColor = System.Drawing.Color.White;
chart.Panel.Gradient.EndColor = System.Drawing.Color.White;
//On active le Scroll, on set la position de départ et la grosseur de vision qu'on veut
// 24 heures / 72 heures = 1/3, donc ~ 30%
((Steema.TeeChart.Tools.ScrollTool)chart.Tools[0]).Active = true;
((Steema.TeeChart.Tools.ScrollTool)chart.Tools[0]).StartPosition = 25;
((Steema.TeeChart.Tools.ScrollTool)chart.Tools[0]).ViewSegmentSize = 35;
}