Simple Bar Chart Graph on Canvas Gadget

Share your advanced PureBasic knowledge/code with the community.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Simple Bar Chart Graph on Canvas Gadget

Post by davido »

@IdeasVacuum

Very nice, indeed. :D
DE AA EB
metalos
User
User
Posts: 29
Joined: Thu Apr 19, 2012 8:32 am

Re: Simple Bar Chart Graph on Canvas Gadget

Post by metalos »

If I change the file contained the HightScore.txt with this data:

Code: Select all

Test1,1
Test2,2
Test3,1
Test4,145
Test5,8
Test6,5
Test7,158
Test8,4
Test9,8
Test10,4
Test11,33
Test12,211
Test13,1100
Test14,130
Test15,39
Test16,19
Test17,19
Test18,41
Test19,5
Test20,4
This is what I get:

Image

How to fix the lag graphics? I try to change the line 147 but to no avail.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: Simple Bar Chart Graph on Canvas Gadget

Post by Tenaja »

An edit like this helps to prevent the score from overwriting the names, when the score is very low:

Code: Select all

			iScoreX = ((iChartX0 + iW) - (TextWidth(StrD(Scores.Player()\iScore,0)) + 5))
			If iScoreX < 150 : iScoreX = 150 : EndIf   ; ADD this line after the above line, in proc DrawBarChart()
metalos
User
User
Posts: 29
Joined: Thu Apr 19, 2012 8:32 am

Re: Simple Bar Chart Graph on Canvas Gadget

Post by metalos »

works fine now thank you.
Post Reply