Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Tables & Charts

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 25th, 2011, 08:28 AM
James.Lee@DG3.com James.Lee@DG3.com is offline
Junior Community Member
 
Join Date: May 2010
Posts: 25
Default Charts: set maximum based on variable

I have three different stacked bar charts on a page. They all have to compare proportionately. i.e. Barchart A total = 600, Barchart B total = 800 and Barchart C total = 1000. They appear in three different locations, so I cannot make them one bar chart. The information also changes between each record. (comparing 80, 90, and 150 in one, while the next compares 1,000, 2,000, and 5,000 as an example) Therefore, I can't just set up a static maximum.

My idea was to have the variable information from the greatest chart (Chart C) appear in a cell that has the visibility set to "hidden" within the lesser charts (Charts A and B). That way the smallest chart is still being drawn with the same maximum as the greatest chart. But I can't find the proper syntax anywhere.

Does anybody have some insight?
Reply With Quote
  #2  
Old March 25th, 2011, 01:13 PM
James.Lee@DG3.com James.Lee@DG3.com is offline
Junior Community Member
 
Join Date: May 2010
Posts: 25
Default Re: Charts: set maximum based on variable

I found a quick and dirty fix for this.

I created a 4th row of data for the stacked chart that subtracted the largest value of the largest chart from the largest value of the small chart. This created an extra bar stacked on top of the small one, pushing it down to be proportional. Then I set the color to match the background so that it could not be seen.

Here's the code:

chart = '<row>';
chart += '<cell>' + Field("DataA1");
chart += '<cell>' + Field("DataB1");
chart += '<cell>' + Field("DataC1");
chart += '<cell>' + Field("DataD1");

chart += '<row>';
chart += '<cell>' + Field("DataA2");
chart += '<cell>' + Field("DataB2");
chart += '<cell>' + Field("DataC2");
chart += '<cell>' + Field("DataD2");

chart += '<row>';
chart += '<cell>' + Field("DataA3small");
chart += '<cell>' + Field("DataB3small");
chart += '<cell>' + Field("DataC3small");
chart += '<cell>' + Field("DataD3small");

chart += '<row>';
chart += '<cell>0';
chart += '<cell>0';
chart += '<cell>0';
chart += '<cell>0'+ (StringToNumber(Field("DataD3Large"))-StringToNumber(Field("DataD3small")));;

return chart
Reply With Quote
Reply

Tags
charts, tables, visibility

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:09 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.