show 0 to 300000 on x axis as % from 10 to 100 - bar graph

60 views
Skip to first unread message

uide...@gmail.com

unread,
Jan 30, 2016, 11:55:10 AM1/30/16
to Flot graphs
I have a horizontal bar graph and I want to show the ticks on x-axis as % from 10 to 100. the sample data is here. I tried a way using percentformatter function and min,max values on x axis and able to get the ticks from 10% to 100% but all bars on graph showing me as 100% which is incorrect. when i try the same with values everything looks good.please let me know how to do this
var rawData = [
{data: [[1033, 0]], color: "red"},
{data: [[1324, 1]], color: "blue"},
{data: [[2057, 2]], color: "green"},
{data: [[14359, 3]], color: "yellow"},
{data: [[16628, 4]], color: "pink"},
{data: [[71979, 5]], color: "magenta"},
{data: [[226158, 6]], color: "cyan"}


 
];

var ticks = [
    [0, "IVR"], [1, "CAE NATPro"], [2, "Dot COM"], [3, "CAE X1"], [4, "CAE SIK"], [5, "Customer Service Center"], [6, "On Screen"]
];


var options = {
    series: {
       
        bars: {
            show: true
        }
    },
    bars: {
        align: "center",
        barWidth: 0.5,
        horizontal: true,
        fillColor: { colors: [{ opacity: 0.5 }, { opacity: 1}] },
        lineWidth: 1
    },
    xaxis: {
        axisLabel: "Total Count of AccountNumber",
        axisLabelUseCanvas: true,
        axisLabelFontSizePixels: 12,
        axisLabelFontFamily: 'Verdana, Arial',
        axisLabelPadding: 10,
        max: 227000,
        tickColor: "#5E5E5E",                       
        stackPercent: true,
        color:"black"
       
    },
    yaxis: {
        axisLabel: "Order Channel",
        axisLabelUseCanvas: true,
        axisLabelFontSizePixels: 12,
        axisLabelFontFamily: 'Verdana, Arial',
        axisLabelPadding: 3,
        tickColor: "#5E5E5E",       
        ticks: ticks,
        color:"black"
    },
    legend: {
        noColumns: 0,
        labelBoxBorderColor: "#858585",
        position: "ne"
    },
    grid: {
        hoverable: true,
        borderWidth: 2,       
       // backgroundColor: { colors: ["#ffffff", "#EDF5FF"] },
        backgroundColor: { colors: ["#171717", "#4F4F4F"] }
    }
};


chris

unread,
Feb 5, 2016, 1:22:22 PM2/5/16
to Flot graphs
Hello uide,

I attach what i have done. I don't know why the first bar plots left.
jflot.7z

Pappas Xristos

unread,
Feb 5, 2016, 1:26:28 PM2/5/16
to flot-...@googlegroups.com
I attach flot library by mistake. Don't look flot folder (includes libraries and examples from http://www.flotcharts.org/).

--

---
You received this message because you are subscribed to the Google Groups "Flot graphs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flot-graphs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages