Giter VIP home page Giter VIP logo

Comments (6)

rakannimer avatar rakannimer commented on May 14, 2024

it uses debug.js so you can set window.localStorage.debug = "*" and see the logs in your browser. Can you attach some code that I can run maybe I can help ?

from react-google-charts.

remotealex avatar remotealex commented on May 14, 2024

Cool thanks. Here's the code for the view with a screenshot.

import React from 'react';
import { withRouter } from 'react-router';
import { Chart } from 'react-google-charts'

import Topbar from '../../base/Topbar';
import Loading from '../../base/Loading';
import WizardNavigation from '../../misc/WizardNavigation';
import StatBlock from '../../story-forms/analyse/StatBlock';

class AnalyseView extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      options: {
        title: 'Age vs. Weight comparison',
        hAxis: {title: 'Age', minValue: 0, maxValue: 15},
        vAxis: {title: 'Weight', minValue: 0, maxValue: 15},
        legend: 'none'
      },
      rows: [
        [8, 12],
        [4, 5.5],
        [11, 14],
        [4, 5],
        [3, 3.5],
        [6.5, 7]
      ],
      columns: [
        {
          'type': 'number',
          'label' : 'Age'
        },
        {
          'type' : 'number',
          'label' : 'Weight'
        }
      ]
    }
  }

  render() {
    const { loading, params } = this.props;

    if (loading) {
      return <Loading />;
    }

    return (
      <div >
        <Topbar category="Campaigns" title="Story Book Analytics" />

        <div className="panel">
          <div className="stat-blocks">
            <StatBlock
              number={19}
              title="Today's views"
              type="today-views"
            />
            <StatBlock
              number={19}
              title="Week's views"
              type="week-views"
            />
            <StatBlock
              number={19}
              title="Month's views"
              type="month-views"
            />
            <StatBlock
              number={19}
              title="Total views"
              type="total-views"
            />
          </div>

          <Chart
            chartType="ScatterChart"
            rows={this.state.rows}
            columns={this.state.columns}
            options={this.state.options}
            loader={<Loading />}
            graph_id="ScatterChart"
            width={"100%"}
            height={"400px"}
          />

        </div>

        <WizardNavigation
          backLink={`/campaigns/story-books/${params.bookId}/share`}
          bookId={params.bookId}
          current="analyse"
        />
      </div>
    );
  }
}

AnalyseView.propTypes = {
  loading: React.PropTypes.bool.isRequired,
  params: React.PropTypes.object.isRequired
};

export default withRouter(AnalyseView);

screen shot 2016-10-13 at 12 25 28

from react-google-charts.

rakannimer avatar rakannimer commented on May 14, 2024

Hey, can you tell me which react-google-charts version and react version you're using ? I couldn't reproduce on latest version with :
[email protected]
[email protected]
?

from react-google-charts.

remotealex avatar remotealex commented on May 14, 2024

I'm using the same versions as that. Also using latest Chrome (Version 54.0.2840.59 beta (64-bit))

from react-google-charts.

rakannimer avatar rakannimer commented on May 14, 2024

Can you try explicitly passing it chartPackages=['corechart'] ? For some reason it's not passing it as a default in your setup.

from react-google-charts.

remotealex avatar remotealex commented on May 14, 2024

@rakannimer Hey sorry I've decided not to include any charts in my app for now. Feel free to close the issue if you can't replicate.

from react-google-charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.