Looking for a good tutorial for connecting data to the Pie Charts and Score Boards

Looking through the documentations I see that October has built in carts and score Board features, however is there a walkthrough or video showing how to connect live data to them?

I am still muddling my way on developing within October so please treat me at a beginner pace because there is a huge amount of info to consume…

Hi @dblackmon,

If you’re referring to Scoreboard, it doesn’t automatically connect to live data — you need to pass the values yourself.

For example, if you are showing a scoreboard inside a controller, you can pass data to your view like this:

public function index()
{
    // Provide data to the view
    $this->vars['scoreboardData'] = 'XYZ';

    // Render the default ListController index
    return $this->asExtension('ListController')->index();
}

Then in your partial (the .htm file), you can display the value:

<?= $scoreboardData ?>

From there, you could replace 'XYZ' with values coming from your database query, API call, or any calculation you need.

So the scoreboard widget itself is just a UI element — it’s up to you to decide what “live data” you want to push into it.

I guess that would be one of the other places I am struggling… The “XYZ” part Im not sure if I can use a SQL statement there, or do I create a View in SQL and then call it from code in October to view what I want to see…

I am pretty old school on the learning part. It helps me to see a couple different examples of how the same thing can be accomplished. Unfortunately no one seems to do documentation like that anymore. Plus all of the Youtube videos out there for October are so old thats its difficult to consider whats relevant or not…

@dblackmon please clone this plugin: GitHub - octobercms/test-plugin: Test Suite & Playground for October CMS

You will see how it’s done :slight_smile:

2 Likes

I appreciate the link…

Looking at the People section and I see the scoreboard part. It appears that the only part that is connected to live data is the first circle chart. Is that correct and if so is there a reason why Mary Smith is reading -2000 and the other two are not reading values.

I just to make sure before I dive too deep into this, because changing the names of the tree indviduals have no affect on the scoreboard.

Thank you,

Doug