MaxPointsPerPage not working...

TeeChart for ActiveX, COM and ASP
landa
Newbie
Newbie
Posts: 30
Joined: Thu Oct 16, 2008 12:00 am
Location: Chico, CA

MaxPointsPerPage not working...

Post by landa » Mon Aug 30, 2010 7:40 pm

Hello,

When using MaxPointsPerPage and setting it to three. Three bars show on the first page and part of the 4th bar.
Is there a way to fix it so that only the maximum number of bars per page shows up?
I'm using version 8.08 of the ActiveX T-Chart.

My code is below and I'm attaching the jpeg of the chart.

Thanks,
Landa


<script language= "JavaScript">
function onloadtchartIncidentsByDepartment1() {

TChartComtchartIncidentsByDepartment1.Chart = tchartIncidentsByDepartment1;
tchartIncidentsByDepartment1.Header.Font.Bold = true;
tchartIncidentsByDepartment1.Header.Font.Name = "Arial";
tchartIncidentsByDepartment1.Header.Font.Size = 14;
tchartIncidentsByDepartment1.Header.Text.Clear();
tchartIncidentsByDepartment1.Header.Text.Add("Incidents By Department (7/1/2009 to 07/31/2010)");
tchartIncidentsByDepartment1.Footer.Font.Bold = true;
tchartIncidentsByDepartment1.Footer.Font.Name = "Arial";
tchartIncidentsByDepartment1.Footer.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Footer.Font.Size = 8;
tchartIncidentsByDepartment1.Footer.Text.Clear();
tchartIncidentsByDepartment1.Footer.Text.Add("this is footer1");
tchartIncidentsByDepartment1.Footer.Text.Add("this is footer2");
tchartIncidentsByDepartment1.Footer.Text.Add("");
tchartIncidentsByDepartment1.Aspect.View3D=true;
tchartIncidentsByDepartment1.Tools.Items(0).Active = true;
tchartIncidentsByDepartment1.Panel.BevelInner = 0;
tchartIncidentsByDepartment1.Panel.BevelOuter = 0;
tchartIncidentsByDepartment1.Panel.BevelWidth = 1;
tchartIncidentsByDepartment1.Panel.BorderStyle = 0;
tchartIncidentsByDepartment1.Panel.Gradient.Visible = true;
tchartIncidentsByDepartment1.Panel.Gradient.Direction = 0;
tchartIncidentsByDepartment1.Panel.Gradient.StartColor = RGB(255,255,255);
tchartIncidentsByDepartment1.Panel.Gradient.EndColor = RGB(105,148,248);
tchartIncidentsByDepartment1.Walls.Left.Color = RGB(105,148,248);
tchartIncidentsByDepartment1.Walls.Bottom.Color = RGB(105,148,248);
tchartIncidentsByDepartment1.Axis.Left.Title.Font.Bold = true;
tchartIncidentsByDepartment1.Axis.Left.Title.Font.Size = 12;
tchartIncidentsByDepartment1.Axis.Left.Title.Caption = "Count";
tchartIncidentsByDepartment1.Axis.Left.maximum=100;
tchartIncidentsByDepartment1.Axis.Left.minimum=0;
tchartIncidentsByDepartment1.Axis.Left.Ticks.Width = 1;
tchartIncidentsByDepartment1.Axis.Left.Ticks.Style = 2;
tchartIncidentsByDepartment1.Axis.Left.Ticks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Left.GridPen.Style = 7;
tchartIncidentsByDepartment1.Axis.Left.GridPen.Color = RGB(128,255,255);
tchartIncidentsByDepartment1.Axis.Left.GridCentered = true;
tchartIncidentsByDepartment1.Axis.Left.Labels.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Left.MinorTicks.Color = RGB(220,220,220);
tchartIncidentsByDepartment1.Axis.Left.MinorTickLength = 1;
tchartIncidentsByDepartment1.Axis.Left.Increment = 5;
tchartIncidentsByDepartment1.Axis.Left.Labels.ValueFormat = '#,##0.###';
tchartIncidentsByDepartment1.Axis.Right.Title.Font.Bold = true;
tchartIncidentsByDepartment1.Axis.Right.Title.Font.Size = 12;
tchartIncidentsByDepartment1.Axis.Right.Title.Caption = "";
tchartIncidentsByDepartment1.Axis.Right.Automatic;
tchartIncidentsByDepartment1.Axis.Right.Ticks.Width = 1;
tchartIncidentsByDepartment1.Axis.Right.Ticks.Style = 2;
tchartIncidentsByDepartment1.Axis.Right.Ticks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Right.GridPen.Style = 7;
tchartIncidentsByDepartment1.Axis.Right.GridPen.Color = RGB(128,255,255);
tchartIncidentsByDepartment1.Axis.Right.GridCentered = true;
tchartIncidentsByDepartment1.Axis.Right.Labels.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Right.MinorTicks.Color = RGB(220,220,220);
tchartIncidentsByDepartment1.Axis.Right.MinorTickLength = 1;
tchartIncidentsByDepartment1.Axis.Right.Increment = 5;
tchartIncidentsByDepartment1.Axis.Bottom.Title.Caption = "Category";
tchartIncidentsByDepartment1.Axis.Bottom.Title.Font.Bold = true;
tchartIncidentsByDepartment1.Axis.Bottom.Title.Font.Size = 12;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Separation = 0;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Angle = 0;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Size = 0;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Angle = 0;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.MultiLine = false;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Bottom.Ticks.Style = 2;
tchartIncidentsByDepartment1.Axis.Bottom.Ticks.Width = 1;
tchartIncidentsByDepartment1.Axis.Bottom.Ticks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Bottom.GridPen.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Bottom.GridPen.Style = 7;
tchartIncidentsByDepartment1.Axis.Bottom.MinorTicks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Bottom.MinorTickLength = 3;
tchartIncidentsByDepartment1.Axis.Top.Title.Caption = "";
tchartIncidentsByDepartment1.Axis.Top.Title.Font.Bold = true;
tchartIncidentsByDepartment1.Axis.Top.Title.Font.Size = 12;
tchartIncidentsByDepartment1.Axis.Top.Labels.Separation = 0;
tchartIncidentsByDepartment1.Axis.Top.Labels.Angle = 0;
tchartIncidentsByDepartment1.Axis.Top.Labels.Size = 0;
tchartIncidentsByDepartment1.Axis.Top.Labels.Angle = 0;
tchartIncidentsByDepartment1.Axis.Top.Labels.MultiLine = false;
tchartIncidentsByDepartment1.Axis.Top.Labels.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Top.Ticks.Style = 2;
tchartIncidentsByDepartment1.Axis.Top.Ticks.Width = 1;
tchartIncidentsByDepartment1.Axis.Top.Ticks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Top.GridPen.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Top.GridPen.Style = 7;
tchartIncidentsByDepartment1.Axis.Top.MinorTicks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Top.MinorTickLength = 3;
tchartIncidentsByDepartment1.Legend.Visible = false;
tchartIncidentsByDepartment1.Legend.ShadowSize = 1;
tchartIncidentsByDepartment1.Legend.LegendStyle = lsValues;
tchartIncidentsByDepartment1.Legend.Alignment = 3;
tchartIncidentsByDepartment1.Legend.Symbol.Width = 5;
tchartIncidentsByDepartment1.Legend.ColorWidth = 12;
tchartIncidentsByDepartment1.Legend.ColumnWidthAuto = true;
tchartIncidentsByDepartment1.Legend.Frame.Visible = true;
tchartIncidentsByDepartment1.Page.MaxPointsPerPage = 3;
tchartIncidentsByDepartment1.RemoveAllSeries();
tchartIncidentsByDepartment1.AddSeries(0) ;
tchartIncidentsByDepartment1.Series(0).Title="Count";
tchartIncidentsByDepartment1.ChangeSeriesType(0, 1);
tchartIncidentsByDepartment1.Series(0).AsBar.BarStyle=6;
tchartIncidentsByDepartment1.Series(0).AsBar.BarPen.Visible = false;
tchartIncidentsByDepartment1.Series(0).Marks.ArrowLength = 5;
tchartIncidentsByDepartment1.Series(0).Marks.Arrow.Visible = false;
tchartIncidentsByDepartment1.Series(0).Marks.ZPosition = 99;
tchartIncidentsByDepartment1.Series(0).Marks.Transparent = true;
tchartIncidentsByDepartment1.Series(0).Marks.Style = 4;
tchartIncidentsByDepartment1.Series(0).Marks.Visible = true;
tchartIncidentsByDepartment1.Series(0).ShowInLegend = true;
tchartIncidentsByDepartment1.Series(0).ValueFormat = "#,##0.###";
tchartIncidentsByDepartment1.Series(0).ColorEachPoint = true;
tchartIncidentsByDepartment1.Series(0).Color = 536870912;
tchartIncidentsByDepartment1.Series(0).VerticalAxis = aLeftAxis;
tchartIncidentsByDepartment1.Series(0).Add (3, "10K", 536870912 );
tchartIncidentsByDepartment1.Series(0).Add (7, "ADMIN", 536870912 );
tchartIncidentsByDepartment1.Series(0).Add (1, "ADMIT", 536870912 );
tchartIncidentsByDepartment1.Series(0).Add (19, "NUR4", 536870912 );
tchartIncidentsByDepartment1.Axis.Left.maximum = 40.7 ;
tchartIncidentsByDepartment1.Axis.Left.minimum = 1 ;
tchartIncidentsByDepartment1.StopMouse();

}

</SCRIPT>
Attachments
MaxPointsPerPage_3.jpg
MaxPointsPerPage_3.jpg (67.01 KiB) Viewed 17058 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: MaxPointsPerPage not working...

Post by Yeray » Tue Aug 31, 2010 1:01 pm

Hi Landa,

Try setting a lower MaximumOffset:

Code: Select all

  TChart1.Axis.Bottom.MinimumOffset = 120
  TChart1.Axis.Bottom.MaximumOffset = 120
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

landa
Newbie
Newbie
Posts: 30
Joined: Thu Oct 16, 2008 12:00 am
Location: Chico, CA

Re: MaxPointsPerPage not working...

Post by landa » Tue Aug 31, 2010 2:28 pm

Hi Yeray,

Thanks for your prompt reply. I added the code that you suggested below. And I noticed with the bar chart on the second page it seems to put all of the bars from the first page ontop of each other. Instead of just showing the last bar. There were four bars total. And I set the MaxPointsPerPage to three. So there should have been just one bar on the second page. I'm attaching a screenshot of the chart.

And my code is below:

<script language= "JavaScript">
function onloadtchart1() {

TChartComtchart1.Chart = tchart1;
tchart1.Header.Font.Bold = true;
tchart1.Header.Font.Name = "Arial";
tchart1.Header.Font.Size = 14;
tchart1.Header.Text.Clear();
tchart1.Header.Text.Add("Incidents By Subject Class (7/1/2009 to 07/31/2010)");
tchart1.Footer.Font.Bold = true;
tchart1.Footer.Font.Name = "Arial";
tchart1.Footer.Font.Color = RGB(0,0,0);
tchart1.Footer.Font.Size = 8;
tchart1.Footer.Text.Clear();
tchart1.Footer.Text.Add("this is footer3");
tchart1.Footer.Text.Add("this is footer2");
tchart1.Footer.Text.Add("this is footer1");
tchart1.Aspect.View3D=true;
tchart1.Tools.Items(0).Active = true;
tchart1.Panel.BevelInner = 0;
tchart1.Panel.BevelOuter = 0;
tchart1.Panel.BevelWidth = 1;
tchart1.Panel.BorderStyle = 0;
tchart1.Panel.Gradient.Visible = true;
tchart1.Panel.Gradient.Direction = 0;
tchart1.Panel.Gradient.StartColor = RGB(255,255,255);
tchart1.Panel.Gradient.EndColor = RGB(105,148,248);
tchart1.Walls.Left.Color = RGB(105,148,248);
tchart1.Walls.Bottom.Color = RGB(105,148,248);
tchart1.Axis.Left.Title.Font.Bold = true;
tchart1.Axis.Left.Title.Font.Size = 12;
tchart1.Axis.Left.Title.Caption = "Incident Count";
tchart1.Axis.Left.maximum=100;
tchart1.Axis.Left.minimum=0;
tchart1.Axis.Left.Ticks.Width = 1;
tchart1.Axis.Left.Ticks.Style = 2;
tchart1.Axis.Left.Ticks.Color = RGB(0,0,0);
tchart1.Axis.Left.GridPen.Style = 7;
tchart1.Axis.Left.GridPen.Color = RGB(128,255,255);
tchart1.Axis.Left.GridCentered = true;
tchart1.Axis.Left.Labels.Font.Color = RGB(0,0,0);
tchart1.Axis.Left.MinorTicks.Color = RGB(220,220,220);
tchart1.Axis.Left.MinorTickLength = 1;
tchart1.Axis.Left.Increment = 5;
tchart1.Axis.Left.Labels.ValueFormat = '#,##0.###';
tchart1.Axis.Right.Title.Font.Bold = true;
tchart1.Axis.Right.Title.Font.Size = 12;
tchart1.Axis.Right.Title.Caption = "";
tchart1.Axis.Right.Automatic;
tchart1.Axis.Right.Ticks.Width = 1;
tchart1.Axis.Right.Ticks.Style = 2;
tchart1.Axis.Right.Ticks.Color = RGB(0,0,0);
tchart1.Axis.Right.GridPen.Style = 7;
tchart1.Axis.Right.GridPen.Color = RGB(128,255,255);
tchart1.Axis.Right.GridCentered = true;
tchart1.Axis.Right.Labels.Font.Color = RGB(0,0,0);
tchart1.Axis.Right.MinorTicks.Color = RGB(220,220,220);
tchart1.Axis.Right.MinorTickLength = 1;
tchart1.Axis.Right.Increment = 5;
tchart1.Axis.Bottom.Title.Caption = "Subject Class";
tchart1.Axis.Bottom.Title.Font.Bold = true;
tchart1.Axis.Bottom.Title.Font.Size = 12;
tchart1.Axis.Bottom.Labels.Separation = 0;
tchart1.Axis.Bottom.Labels.Angle = 0;
tchart1.Axis.Bottom.Labels.Size = 0;
tchart1.Axis.Bottom.Labels.Angle = 0;
tchart1.Axis.Bottom.Labels.MultiLine = false;
tchart1.Axis.Bottom.Labels.Font.Color = RGB(0,0,0);
tchart1.Axis.Bottom.Ticks.Style = 2;
tchart1.Axis.Bottom.Ticks.Width = 1;
tchart1.Axis.Bottom.Ticks.Color = RGB(0,0,0);
tchart1.Axis.Bottom.GridPen.Color = RGB(0,0,0);
tchart1.Axis.Bottom.GridPen.Style = 7;
tchart1.Axis.Bottom.MinorTicks.Color = RGB(0,0,0);
tchart1.Axis.Bottom.MinorTickLength = 3;
tchart1.Axis.Top.Title.Caption = "";
tchart1.Axis.Top.Title.Font.Bold = true;
tchart1.Axis.Top.Title.Font.Size = 12;
tchart1.Axis.Top.Labels.Separation = 0;
tchart1.Axis.Top.Labels.Angle = 0;
tchart1.Axis.Top.Labels.Size = 0;
tchart1.Axis.Top.Labels.Angle = 0;
tchart1.Axis.Top.Labels.MultiLine = false;
tchart1.Axis.Top.Labels.Font.Color = RGB(0,0,0);
tchart1.Axis.Top.Ticks.Style = 2;
tchart1.Axis.Top.Ticks.Width = 1;
tchart1.Axis.Top.Ticks.Color = RGB(0,0,0);
tchart1.Axis.Top.GridPen.Color = RGB(0,0,0);
tchart1.Axis.Top.GridPen.Style = 7;
tchart1.Axis.Top.MinorTicks.Color = RGB(0,0,0);
tchart1.Axis.Top.MinorTickLength = 3;
tchart1.Legend.Visible = false;
tchart1.Legend.ShadowSize = 1;
tchart1.Legend.LegendStyle = 1;
tchart1.Legend.Alignment = 1;
tchart1.Legend.Symbol.Width = 5;
tchart1.Legend.ColorWidth = 12;
tchart1.Legend.ColumnWidthAuto = true;
tchart1.Legend.Frame.Visible = true;
tchart1.Page.MaxPointsPerPage = 3;
tchart1.RemoveAllSeries();
tchart1.AddSeries(0) ;
tchart1.Series(0).Title="Count";
tchart1.ChangeSeriesType(0, 1);
tchart1.Series(0).AsBar.BarStyle=6;
tchart1.Series(0).AsBar.BarPen.Visible = false;
tchart1.Series(0).Marks.ArrowLength = 5;
tchart1.Series(0).Marks.Arrow.Visible = false;
tchart1.Series(0).Marks.ZPosition = 99;
tchart1.Series(0).Marks.Transparent = true;
tchart1.Series(0).Marks.Style = 0;
tchart1.Series(0).Marks.Visible = true;
tchart1.Series(0).ShowInLegend = true;
tchart1.Series(0).ValueFormat = "#,##0.###";
tchart1.Series(0).ColorEachPoint = true;
tchart1.Series(0).Color = 536870912;
tchart1.Series(0).VerticalAxis = aLeftAxis;
tchart1.Series(0).Add (22, "Other", 536870912 );
tchart1.Series(0).Add (11, "Patient", 536870912 );
tchart1.Series(0).Add (2, "Staff", 536870912 );
tchart1.Series(0).Add (1, "Visitor", 536870912 );
tchart1.Axis.Left.maximum = 47.3 ;
tchart1.Axis.Left.minimum = 1 ;
tchart1.Axis.Bottom.MinimumOffset = 120
tchart1.Axis.Bottom.MaximumOffset = 120
tchart1.StopMouse();

}

</SCRIPT>
Attachments
MaxPointsPerPage_SecondPage_BarChart.jpg
The second page seems to put all of the bars ontop of each other. Instead of just showing one bar.
MaxPointsPerPage_SecondPage_BarChart.jpg (53.87 KiB) Viewed 17025 times

landa
Newbie
Newbie
Posts: 30
Joined: Thu Oct 16, 2008 12:00 am
Location: Chico, CA

Re: MaxPointsPerPage not working...

Post by landa » Tue Aug 31, 2010 3:05 pm

I also wanted to add this.... I set the bottom axis to automatic:
chartname.Axis.Bottom.Automatic = true;

And I set the MaxPointsPerPage to 4 and only 3 bars out of four show up.
I'm attaching the jpeg of the chart.

Thanks,
Landa
Attachments
MaxPointsPerPage_4_AutomaticBottom.jpg
Bottom Axis set to Automatic ( 4th Bar Disappears)
MaxPointsPerPage_4_AutomaticBottom.jpg (54.33 KiB) Viewed 17005 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: MaxPointsPerPage not working...

Post by Yeray » Wed Sep 01, 2010 1:27 pm

Hi Landa,
landa wrote:Thanks for your prompt reply. I added the code that you suggested below. And I noticed with the bar chart on the second page it seems to put all of the bars from the first page ontop of each other. Instead of just showing the last bar. There were four bars total. And I set the MaxPointsPerPage to three. So there should have been just one bar on the second page. I'm attaching a screenshot of the chart.
This is a known problem that was discussed here:
http://www.teechart.net/support/viewtop ... 593#p44432
landa wrote:I also wanted to add this.... I set the bottom axis to automatic:
chartname.Axis.Bottom.Automatic = true;

And I set the MaxPointsPerPage to 4 and only 3 bars out of four show up.
I'm attaching the jpeg of the chart.
I think that the problem here is that you are setting a minimum to the left axis that is higher that the blue bar (Visitor), try:

Code: Select all

tChart.Axis.Left.SetMinMax(0, 47.3);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

landa
Newbie
Newbie
Posts: 30
Joined: Thu Oct 16, 2008 12:00 am
Location: Chico, CA

Re: MaxPointsPerPage not working...

Post by landa » Thu Sep 02, 2010 3:24 pm

Hi Yeray,

I tried the setting the Left Min and Max to your suggestion of (0, 47.3)...
But that didn't seem to work. The bar with a value of 1 showed up but the next bar that had a value of 12 did not show up on the chart. I'll attach the jpeg of the chart.

And I tried the code that you suggested on the other issue of all the bars showing up on the last page. And I'm not sure if my code is correct. I put an alert() in the Next_Click event and it didn't seem to show up. So I'm not sure if that event is really being triggered. I'll post my code. Please let me know if there is something wrong.


<script language="JavaScript" FOR="tchartIncidentsByDepartment1" EVENT="Next_Click()">
tchartIncidentsByDepartment1.Page.Next
alert("Next Page");
SetNullstchartIncidentsByDepartment1();
</SCRIPT>


<script language= "JavaScript">
function SetNullstchartIncidentsByDepartment1() {

tchartIncidentsByDepartment1.Series(0).PointColor(0) == tchartIncidentsByDepartment1.Series(0).Color
tchartIncidentsByDepartment1.Series(0).PointColor(1) == tchartIncidentsByDepartment1.Series(0).Color
tchartIncidentsByDepartment1.Series(0).PointColor(2) == tchartIncidentsByDepartment1.Series(0).Color
tchartIncidentsByDepartment1.Series(0).PointColor(3) == tchartIncidentsByDepartment1.Series(0).Color
tchartIncidentsByDepartment1.Series(0).PointColor(4) == tchartIncidentsByDepartment1.Series(0).Color
if ((tchartIncidentsByDepartment1.Page.Current > 1 && tchartIncidentsByDepartment1.Page.Current != tchartIncidentsByDepartment1.Page.Count))
{tchartIncidentsByDepartment1.Series(0).SetNull (tchartIncidentsByDepartment1.Page.Current - 1) * tchartIncidentsByDepartment1.Page.MaxPointsPerPage - 1 }
if (tchartIncidentsByDepartment1.Page.Current < tchartIncidentsByDepartment1.Page.Count)
{ tchartIncidentsByDepartment1.Series(0).SetNull (tchartIncidentsByDepartment1.Page.Current) * tchartIncidentsByDepartment1.Page.MaxPointsPerPage }
if ((tchartIncidentsByDepartment1.Page.Current == tchartIncidentsByDepartment1.Page.Count && (tchartIncidentsByDepartment1.Series(0).Count % tchartIncidentsByDepartment1.Page.MaxPointsPerPage) == 1))
{
var j=0;
for (j=0;j<=tchartIncidentsByDepartment1.Series(0).Count -2;j++)
{ tchartIncidentsByDepartment1.Series(0).SetNull(j); }
}

}

</script>


Thanks,
Landa
Attachments
MaxPointsPerPage_3-ADMIN_Disappear.jpg
Admin with a value of 12 does not show up.
MaxPointsPerPage_3-ADMIN_Disappear.jpg (64.63 KiB) Viewed 16973 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: MaxPointsPerPage not working...

Post by Yeray » Tue Sep 07, 2010 10:27 am

Hi Landa,

The Next_Click function in the suggested code, was a button, not a TeeChart event. However, you could use OnPageChange event to do the same. Here it is a VB6 project with your initial code and with the SetNulls code called at the end of the initialization and at the mentioned event. It seems to work fine for me here.
VBTest.zip
(9.99 KiB) Downloaded 617 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

landa
Newbie
Newbie
Posts: 30
Joined: Thu Oct 16, 2008 12:00 am
Location: Chico, CA

Re: MaxPointsPerPage not working...

Post by landa » Tue Sep 07, 2010 4:07 pm

Hi Yeray,

Thanks again for your prompt response. I think I'm getting a lot closer with the workaround.
The OnPageChange event helped a lot. But something else must be wrong with my code because when I put MaxPointsPerPage to three and hit the next page everything looks good. But then go back to the previous page all of the bars are gone or set to Null.. Not sure exactly what I'm doing wrong. Maybe you can point it out to me.

I'm attaching the chart jpeg without any bars...

Here's my code for the chart again:

<script language= "JavaScript">
function onloadtchartIncidentsByDepartment1() {

TChartComtchartIncidentsByDepartment1.Chart = tchartIncidentsByDepartment1;
tchartIncidentsByDepartment1.Header.Font.Bold = true;
tchartIncidentsByDepartment1.Header.Font.Name = "Arial";
tchartIncidentsByDepartment1.Header.Font.Size = 14;
tchartIncidentsByDepartment1.Header.Text.Clear();
tchartIncidentsByDepartment1.Header.Text.Add("Incidents By Department (08/01/2010 to 08/31/2010)");
tchartIncidentsByDepartment1.Footer.Font.Bold = true;
tchartIncidentsByDepartment1.Footer.Font.Name = "Arial";
tchartIncidentsByDepartment1.Footer.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Footer.Font.Size = 8;
tchartIncidentsByDepartment1.Footer.Text.Clear();
tchartIncidentsByDepartment1.Footer.Text.Add("this is footer1");
tchartIncidentsByDepartment1.Footer.Text.Add("this is footer2");
tchartIncidentsByDepartment1.Footer.Text.Add("this is footer3");
tchartIncidentsByDepartment1.Aspect.View3D=true;
tchartIncidentsByDepartment1.Tools.Items(0).Active = true;
tchartIncidentsByDepartment1.Panel.BevelInner = 0;
tchartIncidentsByDepartment1.Panel.BevelOuter = 0;
tchartIncidentsByDepartment1.Panel.BevelWidth = 1;
tchartIncidentsByDepartment1.Panel.BorderStyle = 0;
tchartIncidentsByDepartment1.Panel.Gradient.Visible = true;
tchartIncidentsByDepartment1.Panel.Gradient.Direction = 0;
tchartIncidentsByDepartment1.Panel.Gradient.StartColor = RGB(255,255,255);
tchartIncidentsByDepartment1.Panel.Gradient.EndColor = RGB(105,148,248);
tchartIncidentsByDepartment1.Walls.Left.Color = RGB(105,148,248);
tchartIncidentsByDepartment1.Walls.Bottom.Color = RGB(105,148,248);
tchartIncidentsByDepartment1.Axis.Left.Title.Font.Bold = true;
tchartIncidentsByDepartment1.Axis.Left.Title.Font.Size = 12;
tchartIncidentsByDepartment1.Axis.Left.Title.Caption = "Count";
tchartIncidentsByDepartment1.Axis.Left.maximum=100;
tchartIncidentsByDepartment1.Axis.Left.minimum=0;
tchartIncidentsByDepartment1.Axis.Left.Ticks.Width = 1;
tchartIncidentsByDepartment1.Axis.Left.Ticks.Style = 2;
tchartIncidentsByDepartment1.Axis.Left.Ticks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Left.GridPen.Style = 7;
tchartIncidentsByDepartment1.Axis.Left.GridPen.Color = RGB(128,255,255);
tchartIncidentsByDepartment1.Axis.Left.GridCentered = true;
tchartIncidentsByDepartment1.Axis.Left.Labels.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Left.MinorTicks.Color = RGB(220,220,220);
tchartIncidentsByDepartment1.Axis.Left.MinorTickLength = 1;
tchartIncidentsByDepartment1.Axis.Left.Increment = 5;
tchartIncidentsByDepartment1.Axis.Left.Labels.ValueFormat = '#,##0.###';
tchartIncidentsByDepartment1.Axis.Right.Title.Font.Bold = true;
tchartIncidentsByDepartment1.Axis.Right.Title.Font.Size = 12;
tchartIncidentsByDepartment1.Axis.Right.Title.Caption = "";
tchartIncidentsByDepartment1.Axis.Right.Automatic;
tchartIncidentsByDepartment1.Axis.Right.Ticks.Width = 1;
tchartIncidentsByDepartment1.Axis.Right.Ticks.Style = 2;
tchartIncidentsByDepartment1.Axis.Right.Ticks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Right.GridPen.Style = 7;
tchartIncidentsByDepartment1.Axis.Right.GridPen.Color = RGB(128,255,255);
tchartIncidentsByDepartment1.Axis.Right.GridCentered = true;
tchartIncidentsByDepartment1.Axis.Right.Labels.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Right.MinorTicks.Color = RGB(220,220,220);
tchartIncidentsByDepartment1.Axis.Right.MinorTickLength = 1;
tchartIncidentsByDepartment1.Axis.Right.Increment = 5;
tchartIncidentsByDepartment1.Axis.Bottom.Title.Caption = "Category";
tchartIncidentsByDepartment1.Axis.Bottom.Title.Font.Bold = true;
tchartIncidentsByDepartment1.Axis.Bottom.Title.Font.Size = 12;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Separation = 0;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Angle = 0;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Size = 0;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Angle = 0;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.MultiLine = false;
tchartIncidentsByDepartment1.Axis.Bottom.Labels.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Bottom.Ticks.Style = 2;
tchartIncidentsByDepartment1.Axis.Bottom.Ticks.Width = 1;
tchartIncidentsByDepartment1.Axis.Bottom.Ticks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Bottom.GridPen.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Bottom.GridPen.Style = 7;
tchartIncidentsByDepartment1.Axis.Bottom.MinorTicks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Bottom.MinorTickLength = 3;
tchartIncidentsByDepartment1.Axis.Top.Title.Caption = "";
tchartIncidentsByDepartment1.Axis.Top.Title.Font.Bold = true;
tchartIncidentsByDepartment1.Axis.Top.Title.Font.Size = 12;
tchartIncidentsByDepartment1.Axis.Top.Labels.Separation = 0;
tchartIncidentsByDepartment1.Axis.Top.Labels.Angle = 0;
tchartIncidentsByDepartment1.Axis.Top.Labels.Size = 0;
tchartIncidentsByDepartment1.Axis.Top.Labels.Angle = 0;
tchartIncidentsByDepartment1.Axis.Top.Labels.MultiLine = false;
tchartIncidentsByDepartment1.Axis.Top.Labels.Font.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Top.Ticks.Style = 2;
tchartIncidentsByDepartment1.Axis.Top.Ticks.Width = 1;
tchartIncidentsByDepartment1.Axis.Top.Ticks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Top.GridPen.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Top.GridPen.Style = 7;
tchartIncidentsByDepartment1.Axis.Top.MinorTicks.Color = RGB(0,0,0);
tchartIncidentsByDepartment1.Axis.Top.MinorTickLength = 3;
tchartIncidentsByDepartment1.Legend.Visible = false;
tchartIncidentsByDepartment1.Legend.ShadowSize = 1;
tchartIncidentsByDepartment1.Legend.LegendStyle = lsValues;
tchartIncidentsByDepartment1.Legend.Alignment = 3;
tchartIncidentsByDepartment1.Legend.Symbol.Width = 5;
tchartIncidentsByDepartment1.Legend.ColorWidth = 12;
tchartIncidentsByDepartment1.Legend.ColumnWidthAuto = true;
tchartIncidentsByDepartment1.Legend.Frame.Visible = true;
tchartIncidentsByDepartment1.RemoveAllSeries();
tchartIncidentsByDepartment1.AddSeries(0) ;
tchartIncidentsByDepartment1.Series(0).Title="Count";
tchartIncidentsByDepartment1.ChangeSeriesType(0, 1);
tchartIncidentsByDepartment1.Series(0).AsBar.BarStyle=6;
tchartIncidentsByDepartment1.Series(0).AsBar.BarPen.Visible = false;
tchartIncidentsByDepartment1.Series(0).Marks.ArrowLength = 5;
tchartIncidentsByDepartment1.Series(0).Marks.Arrow.Visible = false;
tchartIncidentsByDepartment1.Series(0).Marks.ZPosition = 99;
tchartIncidentsByDepartment1.Series(0).Marks.Transparent = true;
tchartIncidentsByDepartment1.Series(0).Marks.Style = 4;
tchartIncidentsByDepartment1.Series(0).Marks.Visible = true;
tchartIncidentsByDepartment1.Series(0).ShowInLegend = true;
tchartIncidentsByDepartment1.Series(0).ValueFormat = "#,##0.###";
tchartIncidentsByDepartment1.Series(0).ColorEachPoint = true;
tchartIncidentsByDepartment1.Series(0).Color = 536870912;
tchartIncidentsByDepartment1.Series(0).VerticalAxis = aLeftAxis;
tchartIncidentsByDepartment1.Series(0).Add (2, "10K", 536870912 );
tchartIncidentsByDepartment1.Series(0).Add (5, "ADMIN", 536870912 );
tchartIncidentsByDepartment1.Series(0).Add (2, "GEN", 536870912 );
tchartIncidentsByDepartment1.Series(0).Add (2, "NUR4", 536870912 );
tchartIncidentsByDepartment1.Axis.Left.maximum = 47.3 ;
tchartIncidentsByDepartment1.Axis.Left.minimum = 0;
tchartIncidentsByDepartment1.Axis.Bottom.Automatic = true;
tchartIncidentsByDepartment1.Page.MaxPointsPerPage = 3;
SetNullstchartIncidentsByDepartment1();
tchartIncidentsByDepartment1.StopMouse();

}

</SCRIPT>

<script language= "JavaScript">
function SetNullstchartIncidentsByDepartment1() {

alert("SetNulls Function Called");
tchartIncidentsByDepartment1.Series(0).PointColor(0) == tchartIncidentsByDepartment1.Series(0).Color
tchartIncidentsByDepartment1.Series(0).PointColor(1) == tchartIncidentsByDepartment1.Series(0).Color
tchartIncidentsByDepartment1.Series(0).PointColor(2) == tchartIncidentsByDepartment1.Series(0).Color
tchartIncidentsByDepartment1.Series(0).PointColor(3) == tchartIncidentsByDepartment1.Series(0).Color
if ((tchartIncidentsByDepartment1.Page.Current > 1 && tchartIncidentsByDepartment1.Page.Current != tchartIncidentsByDepartment1.Page.Count))
{tchartIncidentsByDepartment1.Series(0).SetNull (tchartIncidentsByDepartment1.Page.Current - 1) * tchartIncidentsByDepartment1.Page.MaxPointsPerPage - 1
alert("chart page is greater than 1");}
if ((tchartIncidentsByDepartment1.Page.Current == tchartIncidentsByDepartment1.Page.Count && (tchartIncidentsByDepartment1.Series(0).Count % tchartIncidentsByDepartment1.Page.MaxPointsPerPage) == 1))
{
alert("remainder of chart is 1");
var j=0;
for (j=0;j<=tchartIncidentsByDepartment1.Series(0).Count -2;j++)
{ tchartIncidentsByDepartment1.Series(0).SetNull(j); }
}

}

</script>
Attachments
allbarsgone_previousclick.jpg
Previous Page Click - All Bars Gone
allbarsgone_previousclick.jpg (62.85 KiB) Viewed 16939 times

landa
Newbie
Newbie
Posts: 30
Joined: Thu Oct 16, 2008 12:00 am
Location: Chico, CA

Re: MaxPointsPerPage not working...

Post by landa » Wed Sep 08, 2010 8:31 pm

Hi Yeray,

Can you show me the same code in JavaScript... I'm not sure what I'm doing wrong but when I load the first page.
The admin bar shows up and then disappears once the SetNulls function is called. The admin bar has a value of five.
So it should be there in the chart. And when I go to the next page the last bar shows up fine. All the others are set to null on that page. But when I hit the previous page (go back to page 1) all the bars are missing again.

I see that your vbscript works fine but can you show me the same code and behavior in javascript?
Because I'm a little confused on what my code is missing...

The code in red is where it seems to be having the problem. The admin gets set to null when it shouldn't and then when clicking the previous button on the chart.... all the bars are set to null.

Here is what I have in JavaScript:

function SetNullstchartIncidentsByDepartment1() {

var i=0;
var k=0;

for (k=0; k < tchartIncidentsByDepartment1.Series(i).Count-1; k++)
{ tchartIncidentsByDepartment1.Series(i).PointColor(k) == tchartIncidentsByDepartment1.Series(i).Color }

if ((tchartIncidentsByDepartment1.Page.Current > 1 && tchartIncidentsByDepartment1.Page.Current != tchartIncidentsByDepartment1.Page.Count))
{tchartIncidentsByDepartment1.Series(i).SetNull (tchartIncidentsByDepartment1.Page.Current - 1) * tchartIncidentsByDepartment1.Page.MaxPointsPerPage - 1
alert("chart page is greater than 1");}

if (tchartIncidentsByDepartment1.Page.Current < tchartIncidentsByDepartment1.Page.Count)
{ alert("chart page is less than last page");
tchartIncidentsByDepartment1.Series(i).SetNull (tchartIncidentsByDepartment1.Page.Current) * tchartIncidentsByDepartment1.Page.MaxPointsPerPage



if ((tchartIncidentsByDepartment1.Page.Current == tchartIncidentsByDepartment1.Page.Count && (tchartIncidentsByDepartment1.Series(i).Count % tchartIncidentsByDepartment1.Page.MaxPointsPerPage) == 1))
{
alert("remainder of chart is 1");
var j=0;
for (j=0;j<=tchartIncidentsByDepartment1.Series(i).Count -2;j++)
{ tchartIncidentsByDepartment1.Series(i).SetNull(j); }
}

}

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: MaxPointsPerPage not working...

Post by Yeray » Mon Sep 13, 2010 8:19 am

Hi Landa,

Here it is an example in JavaScript
Attachments
TestJSLive.zip
(1.59 KiB) Downloaded 603 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

landa
Newbie
Newbie
Posts: 30
Joined: Thu Oct 16, 2008 12:00 am
Location: Chico, CA

Re: MaxPointsPerPage not working...

Post by landa » Wed Sep 15, 2010 3:04 pm

Thanks Yeray...

I"m still having problems with this issue. Everytime it sets the nulls all of the bars disappear.
In your javascript it looks like you are loading the URL. I don't believe I can do that in my code.
If we can not load the URL for the chart, how do we refresh all of the data?
And it just seems that it shouldn't be setting all of the bars to null in the first place....

Thanks,
Landa

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: MaxPointsPerPage not working...

Post by Narcís » Thu Sep 16, 2010 2:38 pm

Hi Landa,

Does the example Yeray posted work fine at your end? Can you please modify it so that we can reproduce the problem here?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

landa
Newbie
Newbie
Posts: 30
Joined: Thu Oct 16, 2008 12:00 am
Location: Chico, CA

Re: MaxPointsPerPage not working...

Post by landa » Wed Sep 29, 2010 4:31 pm

Hi Narcis,

I wasn't able to get his javascript example working right on my machine. I'm using cgi script with a unix server but the output is in javascript. I'm not having the chart refresh at all.. Wondering if that is the problem. Is there going to be a release soon with the fixes to the two bugs mentioned in this forum post? I'm wondering because I saw that someone said that you do releases every couple of months. But I havent' seen one since version 8.08 and that was released March of 2010 correct?

If there isn't going to be a release that fixes these issues really soon, then I will need more support for the workarounds.

Thanks,
Landa

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: MaxPointsPerPage not working...

Post by Narcís » Thu Sep 30, 2010 12:08 pm

Hi Landa,
I wasn't able to get his javascript example working right on my machine. I'm using cgi script with a unix server but the output is in javascript. I'm not having the chart refresh at all.. Wondering if that is the problem.
Are the TeeChart ASP Server Examples, included at TeeChart's program group, working at your end? Can you get any ActiveX component running in your server?
Is there going to be a release soon with the fixes to the two bugs mentioned in this forum post? I'm wondering because I saw that someone said that you do releases every couple of months. But I havent' seen one since version 8.08 and that was released March of 2010 correct?

If there isn't going to be a release that fixes these issues really soon, then I will need more support for the workarounds.
I think there will another v8 release but can tell you what will be fixed on it at this stage. The only issue I have found in this thread is TV52014593, which hasn't been fixed yet. I have increased its priority in the bug list. Have I missed any other issue?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: MaxPointsPerPage not working...

Post by Yeray » Thu Sep 30, 2010 1:21 pm

Hi Landa,

Just an additional comment. I've just verified that the recently published TeeChart ActiveX v2010 has fixed both TV52014593 and TV52014098. So, with it you shouldn't need to use the SetNulls method.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply