Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?', function (data) {
- Highcharts.chart('container', {
- chart: {
- zoomType: 'x'
- },
- title: {
- text: 'Visits on x'
- },
- subtitle: {
- text: document.ontouchstart === undefined ?
- 'Click and drag in the plot area to zoom in' : 'Pinch the chart to zoom in'
- },
- xAxis: {
- type: 'datetime'
- },
- yAxis: {
- title: {
- text: 'Visits'
- }
- },
- legend: {
- enabled: false
- },
- plotOptions: {
- area: {
- fillColor: {
- linearGradient: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 1
- },
- stops: [
- [0, Highcharts.getOptions().colors[0]],
- [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
- ]
- },
- marker: {
- radius: 2
- },
- lineWidth: 1,
- states: {
- hover: {
- lineWidth: 1
- }
- },
- threshold: null
- }
- },
- series: [{
- type: 'area',
- name: 'Visits',
- data: data
- }]
- });
- try
- {
- $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
- $username = "dbname"; //DB USERNAME
- $password = "dbpw"; //DB PASSWORD
- $datab = new PDO('mysql:host=127.0.0.1;dbname=db', $username, $password, $pdo_options);
- }
- catch (Exception $e)
- {
- echo "hiba: ".$e->getMessage();
- die();
- }
- $visits = $datab->prepare("SELECT * FROM views WHERE page ='index'");
- $visits->execute();
- $counter = $visits->fetch(PDO::FETCH_ASSOC);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement