Preload Chrtjs In Action Not In Config File

Hi All,

I am using chartjs library for displaying chart. In the documentation

http://www.yiiframework.com/extension/yii-chartjs/

I found, to use this library I need to preload this extension in config file.

But I am using charts only 3 or 4 places in my application, So I don’t want to preload this library.

How can I load this extension, in the perticular action or view level, not in the configuration level.

I tried using the same like this "$this->widget(

            'application.extensions.chartjs.components.ChartJs',"

But it did not help me :(

Thanks in advance!

Why not preload? It should not use much performance.

Thanks Bjorn for your reply.

I don’t want to use preload as I am not only using this library, I am using “flot.js” also. I am not gonna frequently use chartjs library in application. Therefore I dont want to load this un-necessarily in the application.

But isn’t it that this will use Lazy loading? So when you don’t call it, it won’t load at all? That was my understanding of the Lazy loading system.