O'Reilly logo

Highcharts Cookbook by Nicholas Terwoord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a chart from model data

Now that we've set up our base project, we can really get started with the Yii framework. Since non-static data is typically stored in models, we'll begin by creating a chart from the model data.

Getting ready

To set up the basic Yii project, refer to the Setting up a simple Yii Project recipe from this chapter.

How to do it...

Perform the following steps to create a chart from the model data:

  1. Open example_app/protected/data/testdrive.db using the following command:
    sqlite3 example_app/protected/data/testdrive.db
  2. Create a table for our data using the following code:
    CREATE TABLE tbl_monster ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name VARCHAR(32) NOT NULL, height REAL, weight REAL, hp INTEGER, attack INTEGER, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required