Author

Topic: How to develop a bitcoin price chart? (Read 662 times)

legendary
Activity: 1022
Merit: 1003
𝓗𝓞𝓓𝓛
July 10, 2015, 09:51:51 PM
#3
You want to make a Bitcoin price chart, please inform me when it finish. Cheesy
I maybe can try it
legendary
Activity: 1442
Merit: 1186
July 10, 2015, 07:07:36 PM
#2
Are you just looking for a simple line chart?
Personally, I would create PHP file that pulled the current price and then log the time and price to a database . I'd set a cron job so that it runs once every minute. So you'd have a sql table that looked something like this:

Code:
-------------------------
price         |     time
====================
285.24      |     8:57
285.88      |     8:56
283.65      |     8:55
284.01      |     8:54

From there just query your database and do a loop for each price instance that is in your database. Output your loops into the Labels and Data variables in the JS.

Code:


Code:
var data = {
    labels: [sqlLabels],
    datasets: [
        {
            label: "My First dataset",
            fillColor: "rgba(220,220,220,0.2)",
            strokeColor: "rgba(220,220,220,1)",
            pointColor: "rgba(220,220,220,1)",
            pointStrokeColor: "#fff",
            pointHighlightFill: "#fff",
            pointHighlightStroke: "rgba(220,220,220,1)",
            data: [sqlPrices]
        }
    ]
};

hero member
Activity: 896
Merit: 1000
July 10, 2015, 05:11:34 AM
#1
Developers please guide us how to develop a bitcoin chart using www.chartjs.org and also for other altcoin.

Show by examples!
Jump to: