Advertisement:

Author Topic: Simple Chart V 0.5  (Read 33022 times)

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Simple Chart V 0.5
« on: October 25, 2012, 11:37:07 PM »
Link to Mod


Simple Chart 0.5
By Akyhne

Compatibility
SMF 2.0.x
SMF 2.1 Alpha 1

 
Introduction
With this modification, you can insert charts in your forum. The modification supports:
* One-level vertical or horizontal charts
* Multi level vertical or horizontal charts
* One-level pie charts
* One-level, 1 value gauge charts
* One-level stars charts


Unistallation
Just uninstall the mod as usual from the package center.


Where to change settings for the mod
There are no settings you can change with this mod!

Usage
The BBC syntax for this mod, is as follow:

[chart
width={int} (optional)
height={int} (optional)
title="string" (optional)
align=left|right|center|none (optional)
layout=v|h|pie|gauge|stars (optional)
style=MyStyle (optional)
max={int} (optional)
]
Apples=5|Bananas=3|Lemons=10
[/chart]

Example:
[chart width=300 height=250 title="My Fruits" align=center layout=v style=GreenColumn max=10]Apples=5|Bananas=3|Lemons=9[/chart]



Important!
Pie charts as well as gauge charts are generated in the SVG format!
SVG (Scalable Vector Graphics) is a vector based format, developed by the W3 Consortium since 1999. Unfortunately, not all browsers support this format or support it directly.
This means that not all your visitors will be able to see the SVG Pie & Gauge charts.

Browsers with SVG support (that I know of):
IE9, Firefox, Google Chrome, Opera, Safari & the Android browser. Iphones (at least via an emulator).

Browsers with no SVG support (that I know of):
IE 8 & down. However there are SVG plugins on the internet to these browsers. Adobe made one: http://www.adobe.com/support/downloads/product.jsp?product=46&platform=Windows



Supported languages
English
English British
Danish


Examples:

[chart width=550 title="IQ of forum administrators" align=right layout=h max=500]FB=25|IPB=100|MyBB=80|phpBB=70,3|SMF=210|Xen Foro=110|Vbulletin=80[/chart]


[chart width=550 height=400 title="IQ of forum administrators" align=left layout=v max=220]IPB=100|MyBB=80|phpBB=70,3|SMF=210|Xen Foro=110|Vbulletin=80[/chart]


[chart width=400 title="Multi Level - Horizontal"]a=1;2;4,3;2.22;3,33|b=3;1;5|c=2;2.5[/chart]


[chart title="Forum software" layout=pie]IPB=100|MyBB=80|phpBB=70,3|SMF=210|Xen Foro=110|Vbulletin=80[/chart]


[chart title="Standard" layout=gauge]a=50[/chart]


[chart layout=stars]x=5.5[/chart]


Gauge styles: (use them, by adding style=speedometer or style=radar etc.)
standard, graygauge, speedometer, racer, half, radar, blueglass, temp, kungfu & time


Stars styles: (use them, but adding style=book or style=led etc.)
default, led, book



Additional Notes!
Styling
You can style x-y charts, by editing the simplechart.css in your theme's folder. If you add a style=myownstyle or similar to the BBC, you can style individual charts easy with css.
You can style pies via the pie.css file. This controls the styling of the svg generated pie chart.
You can define your own gauge styles. It is a bit complicated, but you basically just edit the $style and the array $style_types in SimpleGauge.php.
You can very easy add your own star icons. Just read the readme.txt in the stars image folder.


Changelog

0.1 6th October 2012
o First beta

0.2 9th October 2012
! Changed the mod to use hooks where possible
+ Added multi level charts
! Cleaned code a bit

0.3 13th October 2012
+ Added the style tag. You can now style each chart, by adding additional styles to the chart's css stylesheet.
! Renamed the "dir" tag to "layout". Suits better!
+ Added pie charts generated in SVG format.

0.4 24th October 2012
+ first submission to SMF's mod site
+ Added gauge charts (SVG format)
+ Added stars charts (PNG images)
! Rearranged the package-info.xml file

0.5 1st November 2012
! If you posted a x-y chart in a BBC table, bars floated to the top
! Removed a bit of code in the DB installscript, that didn't belong there
! Corrected a small issue in the language files
+ Added a "time" gauge style
! Made sure non declared variables do not throw an error
+ Added preparation for the help button
+ Added language strings for the help button
! Fixed layout issues with pie text strings braking layout when more than 18 values used.
! Fixed width of pies, when exceeding 40 values (overkill, but..)
+ Added compression to the link for pies, to shrink it. Saves 30-60%!
+ Text is shrinked in pies, if the text is to long.
! Adjusted position of "procentage" text on pies
+ Added a script to help you generate the code to your charts. The file can be found/called from your forum address: http://yourforum.tld/Simple_Chart/bbc_generator.php
« Last Edit: November 01, 2012, 04:31:24 PM by Akyhne »

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,471
  • Master of BBC Abuse
Re: Simple Chart
« Reply #1 on: October 25, 2012, 11:59:59 PM »
Nice job. Congrats on the release. :)

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Simple Chart
« Reply #2 on: October 26, 2012, 12:09:06 AM »
Thanks :)

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,157
  • Gender: Male
    • i30 Owners Club
Re: Simple Chart
« Reply #3 on: October 26, 2012, 03:18:54 AM »
At last. Been waiting for this. Well done on a nice (and potentially very popular) mod  :laugh:

Of course, a lot of folk are now going to look for ways to use it all over their forums. Actually, I'm talking about myself there  8)

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Simple Chart
« Reply #4 on: October 26, 2012, 03:38:34 AM »
Hmm, yeah. There are so many possabilities & options that I can hardly remember them myself lol

Offline mrintech

  • Full Member
  • ***
  • Posts: 414
  • Gender: Male
Re: Simple Chart
« Reply #5 on: October 26, 2012, 03:54:49 AM »
Very Nice :)

Thanks and Congrats


Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,157
  • Gender: Male
    • i30 Owners Club
Re: Simple Chart
« Reply #6 on: October 26, 2012, 03:54:57 AM »
Can someone try this and see what they get?


Code: [Select]
[chart title="Oz Inputs" layout=pie min=1 max=20]WA=5|NT=8|QLD=2[/chart]

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Simple Chart
« Reply #7 on: October 26, 2012, 04:04:29 AM »
There is no min value.

[chart title="Oz Inputs" layout=pie max=20]WA=5|NT=8|QLD=2[/chart]

or.. skip the max value if you want the pie to go full 360°

[chart title="Oz Inputs" layout=pie]WA=5|NT=8|QLD=2[/chart]

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,157
  • Gender: Male
    • i30 Owners Club
Re: Simple Chart
« Reply #8 on: October 26, 2012, 04:10:37 AM »
Yep - that's sorted it, sort of.

I think I need to concentrate on my color styles next...


Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Simple Chart
« Reply #9 on: October 26, 2012, 04:13:56 AM »
The max value can be used to pies, if you don't want the pie to be closed.

Other than that, the max is only for x-y charts.
Say you have some values, a=5, b=3, c=4, d=7, e=8. Posting that, will make the 'e' value go to full width or height, depending on the layout. That doesn't nessescarily looks nice. So a max=10 will shrink the values a bit, so that 'e' will be 80% in size.

I think I need to concentrate on my color styles next...
I see no image.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,157
  • Gender: Male
    • i30 Owners Club
Re: Simple Chart
« Reply #10 on: October 26, 2012, 04:27:06 AM »
I see no image.

That's what I meant ;)

Can't get any image to show... css debug shows this:

Code: [Select]
<object class="pie_object" data="http://www.i30ownersclub.com/forum/Simple_Chart/SimplePie.php?data=WA%3A%3A%3A5%7CNT%3A%3A%3A8%7CQLD%3A%3A%3A2&amp;max=360"></object>

I'll keep plugging away..

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Simple Chart
« Reply #11 on: October 26, 2012, 04:38:19 AM »
It seems the Simple_Chart folder in the root of http://www.i30ownersclub.com/forum/ doesn't exist!

Did you have any error during installation?

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,157
  • Gender: Male
    • i30 Owners Club
Re: Simple Chart
« Reply #12 on: October 26, 2012, 04:40:01 AM »
Nope - no errors. I'll go check that folder....



EDIT: All folders intact

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,157
  • Gender: Male
    • i30 Owners Club
Re: Simple Chart
« Reply #13 on: October 26, 2012, 04:51:03 AM »
Should I be seeing some "svg" code in the source of my page output?

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Simple Chart
« Reply #14 on: October 26, 2012, 04:54:11 AM »
No.

Offline bolubeyi61

  • Sr. Member
  • ****
  • Posts: 758
  • Gender: Male
    • Spina Bifida Turkey
Re: Simple Chart
« Reply #15 on: October 26, 2012, 07:13:32 AM »
thank you.

Offline Jessica.

  • Full Member
  • ***
  • Posts: 468
  • Gender: Female
  • I use SMF 2.0.2, Default theme
    • Testing Zone
Re: Simple Chart
« Reply #16 on: October 27, 2012, 03:29:15 PM »
I posted a test topic (http://testinggrounds.net84.net/index.php?topic=22.0). The chart appears, but this also appears, above the pie chart

This page contains the following errors:

error on line 117 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.


I didn't get any errors on installation

Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Simple Chart
« Reply #17 on: October 27, 2012, 03:46:30 PM »
You got a script on your site, creating warnings about invalid markup:
http://validator.w3.org/check?uri=http%3A%2F%2Ftestinggrounds.net84.net%2Findex.php%3Ftopic%3D22.0&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3

Hmm..
Code: [Select]
</body></html>
<!-- Hosting24 Analytics Code -->
<script type="text/javascript" src="http://stats.hosting24.com/count.php"></script>
<!-- End Of Analytics Code -->

Offline Jessica.

  • Full Member
  • ***
  • Posts: 468
  • Gender: Female
  • I use SMF 2.0.2, Default theme
    • Testing Zone
Re: Simple Chart
« Reply #18 on: October 27, 2012, 05:59:27 PM »
Wait, what file do I look in to remove that?
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

Offline Akyhne

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,331
Re: Simple Chart
« Reply #19 on: October 28, 2012, 04:33:20 AM »
Well, did you add that hosting24 analytics code via a mod or what?