Posted 21 March 2019, 10:42 am EST
Hello,
I am trying to create a bar graph that has a salesmen name when you hover over it with the mouse but says their territory number at the bottom. I can get it to say the territory just fine when I hover over Im just not sure how to pass the data for each of their names through to the individual bars. I have their names in the same format as the other data (x and y).
Can i somehow pass it through like X and Y are passed through? or is there some other easier way.
Also I know i might be on an older version but I am not sure what version this is, I am re-writing existing code.
Thanks in advanced for any help!
require(["wijmo.wijbarchart"], function () {
$(document).ready(function () {
chart1 = $("#bannerBySalesmen").wijbarchart({
horizontal: false,
axis: { y: { text: "Goal (Percent)", min: -100, max: 100, autoMin: false, autoMax: false },
x: { textStyle: { "font-weight": "normal" } } },
hint: { content: function() { return this.label + '\'s Progress\n ' + this.y + '%'; } },
header: { text: "Banner Sales" },
seriesList: [{ legendEntry: false, data: {
x: [<? echo $salesPeople; ?>],
y: [<? echo $salesPercent;?>] } }],
seriesStyles: [ { fill: "rgb(136,189,230)", stroke: "none" } ],
painted: function (args) {
<?
$countArray = count($salesPercentArray);
for($i=0; $i <= $countArray; $i++)
{
//echos out green for positive red for negitive
if($salesPercentArray[$i] >= 0)
{
echo ('var bar = $(this).wijbarchart("getBar", '.$i.'); bar.attr({ fill: "#009900" });');
}
else
{
echo ('var bar = $(this).wijbarchart("getBar", '.$i.'); bar.attr({ fill: "#CE2522" });');
}
}
?>
}
});
});
});