i3ambii
Forum Replies Created
-
Forum: Plugins
In reply to: [WordPress Charts] Change of numbers on the vertical of BarchartWhat do you mean by change them?
The Y axis is connected to the data in the bar…?
You’re really going to have to be more specific.
Forum: Plugins
In reply to: [WordPress Charts] The plugin does not have a valid header.…Care to elaborate?
You’ve not mentioned the error, or any information. Nobody is going to be able to help you :/.
Forum: Plugins
In reply to: [WordPress Charts] Remote DB as inputYou can dynamically build the shortcode with PHP, so if you can access the remote database okay, yes, you can feed it to WP charts.
After a quick Google, something similar to the below may do the trick to get you connected. Obviously you will need to know the structure of the DB if you wish to query it!
<?php mysql_connect("mysite.com:3306", "admin", "1admin") or die(mysql_error()); echo "Connected to MySQL<br />"; ?>
Never tried it myself mind!
Hope this helps,
Ryan
Forum: Plugins
In reply to: [WordPress Charts] Passing the number via phpI’ve done mine like this and it works for me, (I’ve deleted all the labels and settings to make it clearer). I only dynamically fill the ‘datasets’ and/or labels, not the whole shortcode.
<div><?php echo do_shortcode('[wp_charts title="twitterChart" animation="false" type="line" datasets="' . $data . '" labels="xxx"]'); ?></div>
Here try this for your situation, obviously change $data to fill with your MySQL query.
$data = "98,94,90,89,88"; echo do_shortcode('[wp_charts title="barchart" type="bar" align="alignleft" margin="5px 20px" datasets="' . $data . '"]');
I haven’t tested this but it works on mine, if there’s any errors just echo out your $data to ensure your foreach loop is building $data correctly.
If that doesn’t work, look at possibly changing your foreach loop for a for loop? I personally build my query with the below because my columns are numbered from 1 > 100:
$sql = "SELECT * FROM temperatur
WHERE area = ‘london’ LIMIT 1″;
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($result);for ($x=1; $x<=100; $x++) {
$data .= $row[‘$x’] . “,”;
};echo $data;`
Hope this sets you on the right path! The dev of this app seems to have died so thought I’d try help.
Ryan
Forum: Plugins
In reply to: [WordPress Charts] Only one chart appears per pageHave you given each chart a unique title?