Sign in to follow this  
knives

manually set secondary y axis value

Recommended Posts

hi 

 

using this code in documentation of

Multi-series Stacked Column 2D + Line Dual Y Axis

 

how can i manually set the secondary values to display this values  14, 29, 43, 57, 71, 86, 100????????

 

 

FusionCharts.ready(function(){

        var myChart = new FusionCharts({
            "type": "msstackedcolumn2dlinedy",
            "dataFormat": "jsonurl",
            "dataSource":
{

   "chart": {
      "caption": "Quarterly Sales vs. Profit % in Last Year",
      "subcaption": "Product-wise Break-up - Harry's SuperMart",
      "xAxisName": "Quarter",
      "pYAxisName": "Sales",
      "sYAxisName": "Profit %",
      "numberPrefix": "$",
      "numbersuffix": "M",
      "sNumberSuffix": "%",
      "sYAxisMaxValue": "25",
      "paletteColors": "#5598c3,#2785c3,#31cc77,#1aaf5d,#f45b00",
      "baseFontColor": "#333333",
      "baseFont": "Helvetica Neue,Arial",
      "captionFontSize": "14",
      "subcaptionFontSize": "14",
      "subcaptionFontBold": "0",
      "showBorder": "0",
      "bgColor": "#ffffff",
      "showShadow": "0",
      "canvasBgColor": "#ffffff",
      "canvasBorderAlpha": "0",
      "divlineAlpha": "100",
      "divlineColor": "#999999",
      "divlineThickness": "1",
      "divLineDashed": "1",
      "divLineDashLen": "1",
      "divLineGapLen": "1",
      "usePlotGradientColor": "0",
      "showplotborder": "0",
      "valueFontColor": "#ffffff",
      "placeValuesInside": "1",
      "showXAxisLine": "1",
      "xAxisLineThickness": "1",
      "xAxisLineColor": "#999999",
      "showAlternateHGridColor": "0",
      "legendBgAlpha": "0",
      "legendBorderAlpha": "0",
      "legendShadow": "0",
      "legendItemFontSize": "10",
      "legendItemFontColor": "#666666"
   },
   "categories": [
      {
         "category": [
            {
               "label": "Q1"
            },
            {
               "label": "Q2"
            },
            {
               "label": "Q3"
            },
            {
               "label": "Q4"
            }
         ]
      }
   ],
   "dataset": [
      {
         "dataset": [
            {
               "seriesname": "Processed Food",
               "data": [
                  {
                     "value": "30"
                  },
                  {
                     "value": "26"
                  },
                  {
                     "value": "33"
                  },
                  {
                     "value": "31"
                  }
               ]
            },
            {
               "seriesname": "Un-Processed Food",
               "data": [
                  {
                     "value": "21"
                  },
                  {
                     "value": "28"
                  },
                  {
                     "value": "39"
                  },
                  {
                     "value": "41"
                  }
               ]
            }
         ]
      },
      {
         "dataset": [
            {
               "seriesname": "Electronics",
               "data": [
                  {
                     "value": "27"
                  },
                  {
                     "value": "25"
                  },
                  {
                     "value": "28"
                  },
                  {
                     "value": "26"
                  }
               ]
            },
            {
               "seriesname": "Apparels",
               "data": [
                  {
                     "value": "17"
                  },
                  {
                     "value": "15"
                  },
                  {
                     "value": "18"
                  },
                  {
                     "value": "16"
                  }
               ]
            }
         ]
      }
   ],
   "lineset": [
      {
         "seriesname": "Profit %",
         "showValues": "0",
         "data": [
            {
               "value": "14"
            },
            {
               "value": "16"
            },
            {
               "value": "15"
            },
            {
               "value": "17"
            }
         ]
      }
   ]
}

 

        });
    });

 

Share this post


Link to post
Share on other sites

Hi,

 

To set the the secondary y-axis limits externally you have to disable the auto adjustment of the div with the "AdjustDiv" attribute to 0. It disables the automatic adjustment of divisional lines and allows you to explicitly specify the number of div lines to render as well as the y-axis lower and upper limits.

 

With the attributes "sYAxisMinValue" and "sYAxisMaxValue" you can specify the lower and upper limits respectively for y-axis. And with "numdivlines" attributes you can specify the number if horizontal div lines for y-axis.

 

Please refer the fiddle for implementation : " http://jsfiddle.net/moonmi/wod0um8y/

 

Refer the documentation for supported attributes : http://docs.fusioncharts.com/tutorial-attr-msstcollinedy.html

 

Hope this helps.

 

Thanks.

Share this post


Link to post
Share on other sites


Hello,

 

Thanks for the query. 

 

FusionCharts XT automatically tries to adjust divisional lines and limit values based on the data provided. However, if you want to set your explicit lower and upper limit values and number of divisional lines, first set "adjustDiv"  attribute to false. That will disable automatic adjustment of divisional lines. 

 

The Number of horizontal axis division lines that you want on the chart can be adjust by numDivLines attribute. 

 

You can adjust the div and limits by setting both the primary y-axis and secondary y-axis with the attributes "pYAxisMaxValue", " pYAxisMinValue", "sYAxisMinValue" , "sYAxisMaxValue"  respectively.

 

But the numDivLines will be same for both the y-axis.. 

 

Please refer the fiddle link below for the implementation. 


 

Hope this helps

Kind regards,


Edited by Prerana

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this