Wrong valueindex in WebChart_ClickSeries event !

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
genesis
Newbie
Newbie
Posts: 6
Joined: Fri Mar 31, 2006 12:00 am

Wrong valueindex in WebChart_ClickSeries event !

Post by genesis » Tue Aug 08, 2006 3:40 am

I get 24 records from DB and set webchart.maxpointsperpage=10.
AfterI change webchart.current=2 (it draws correct) and click the last point (valueindex should be 3) of chart , it can't return the correct valueindex or even can't trigger in click event. But it does not happen when I click other points in all pages.

To improve the performance, I use template chart at Page_Load as below code.

------------------------------------------------------------------------
Steema.TeeChart.Chart ch2 = rptWebChart.Chart;
MemoryStream tmpChart = new MemoryStream();
//
if (!IsPostBack)
{
hfChartId.Value = Guid.NewGuid().ToString();
//Value Initial
qryiostatistics wf = (qryiostatistics)Context.Handler;
Set_Initial_Value(wf);
//set back to query url at page_load
ctlOthers.BackToQueryStr = hfBackToQuery.Value;
//get data from SQL and web chart setting
Draw_Chart();
//Localize Grid Column headtext
}
else
{if (Session[hfChartId.Value] != null)
{
//retrieve the session stored Chart
tmpChart = (MemoryStream)Session[hfChartId.Value];
//set the Stream position to 0 as the last read/write
//will have moved the position to the end of the stream
tmpChart.Position = 0;
//import saved Chart
ch2.Import.Template.Load(tmpChart);
}
}
-----------------------------------------------------------------------

The Draw_Chart code is as below.
-------------------------------------------------------------------------
MemoryStream tmpChart = new MemoryStream();
Set_DataGrid();
//set web chart data
WebChart_Process();
//set max chart per page
rptWebChart.Chart.Page.MaxPointsPerPage = Convert.ToInt32(ctlChart.ChartNumSelected);
//set page count
ctlChart.TotalPageSelected = rptWebChart.Chart.Page.Count.ToString();
//set chart page
SetCurrentPage(ctlChart.TotalPageSelected);
//set current page
rptWebChart.Chart.Page.Current = Convert.ToInt32(ctlChart.CurrentPageSelected);
//rptWebChart.Chart.Series[0].GetSeriesMark += new Steema.TeeChart.Styles.Series.GetSeriesMarkEventHandler(this.serial_Num_GetSeriesMark);

//export Chart to a MemoryStream template
rptWebChart.Chart.Export.Template.Save(tmpChart);
//save template to a Session variable
Session.Add(hfChartId.Value, tmpChart);

-----------------------------------------------------------------------

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue Aug 08, 2006 10:45 am

Hello,

Can't you use the valueindex returned to calculate the real valueindex? That is, if the index returned is three and the current page is two then the real value index is (3 + (2 * MaxPointsPerPage)).
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

genesis
Newbie
Newbie
Posts: 6
Joined: Fri Mar 31, 2006 12:00 am

Post by genesis » Wed Aug 09, 2006 1:08 am

I did it already in ClickSeries event as below
---------------------------------------------------
int trueIndex = rptWebChart.Chart.Page.MaxPointsPerPage * (Convert.ToInt32(ctlChart.CurrentPageSelected)-1) + valueIndex;
//set current select def code value
hfStageStr.Value = s.Labels[trueIndex].ToString();
---------------------------------------------------------

Let me anounce again, it just can't get right valueindex at last point of last page and the others are correct.

Please support to check that.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Wed Aug 09, 2006 8:18 am

Hello,

OK. Would you be so kind as to send me *.aspx/*.aspx.cs (or *.aspx.vb) files which I can run 'as-is' to reproduce the problem here?

Many thanks!!
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply