Bars not showing correctly

22 views
Skip to first unread message

Cliff Tussey

unread,
Aug 29, 2024, 2:03:50 PM8/29/24
to jQuery Sparkline
Hello,

I'm doing a bar chart.   I've verified that the values going in are correct
and they show correctly in the correct tooltip format on mouseover.   
But the bars don't correspond to the data in scaling and positive and 
negative valued bars seemed reversed.   
 
I provide data and charts for the 2 charts to the right on each chart image 
line in the image below.    The line chart (2nd data line) is right, but the bars 
on the bar chart are not (1st  data line).   Any help is appreciated including 
the right way to do a bar chart.   Thanks.     Cliff Tussey

Screenshot (287).png

Cliff Tussey

unread,
Aug 30, 2024, 1:21:51 PM8/30/24
to jQuery Sparkline
Hello again.

i'm getting several strange behaviors including not scaling correctly, positive values showing as negative bars, little tick marks at the end of the chart lines of chart lines 2, 3, and 4, 
and a small colored circle shape appearing when I mouse over the most recent bar of chart line 1 just below the tooltip.   I'm sure its me.   I just don't no what I'm doing wrong.   

The bar chart definition follows.

$('.inlinebar4').sparkline('html', {width:'4em', fillColor:'white', lineColor:'white', spotColor:'', minSpotColor:'', maxSpotColor:'', highlightSpotColor:null, highlightLineColor:null, tooltipFormat:'{{x}} = {{y.2}}', numberDigitGroupSep:'', tagValuesAttribute:'linevalues'});
$('.inlinebar4').sparkline('html', {type:'bar', barColor:'blue', negBarColor:'red', tagValuesAttribute:'barvalues', composite:'true', disableInteraction:'true', barWidth:6, barSpacing:1});

The inline definition follows.

<SPAN CLASS='inlinebar$m'  barvalues='$stride2[$i]' linevalues='$stride3[$i]' TITLE='Stride / %' ONMOUSEOVER=\"setStatus(' ');\" ONMOUSEOUT=\"setStatus(' ');\"></SPAN>

I would be happy with a simple barchart that scaled correctly, had positive bars for positive values and negative bars for negative values, and no tick marks or strange colored circles appearing on mouseover.

I have tried a simple bar chart definition like the following.

$('.inlinebar4').sparkline('html', {width:'4em', barColor: 'red', negBarColor:'red', tooltipFormat:'{{x}} = {{y.2}}', fillColor:''} );

The inline part follows.

<SPAN CLASS='inlinebar$m'  TITLE='Stride / %'>$stride2[$i]</SPAN>

The bar chart did not show at all.

I think I need some guidance on this.
Cliff Tussey
 

Cliff Tussey

unread,
Aug 30, 2024, 3:19:53 PM8/30/24
to jQuery Sparkline
I found the problem.   I was sending data into the inline code that had the right values but was in the wrong format.     I apologize for not catching this and having wasted 
the time of everyone that looked at this.   I'm sorry.

Thanks 
Cliff Tussey

Reply all
Reply to author
Forward
0 new messages