Using Highcharts (etc.) in Aware IM

Contains tips for configurators working with Aware IM
Post Reply
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Using Highcharts (etc.) in Aware IM

Post by hpl123 »

Hi all,
Here is a tip on how to use the Highcharts library of charts in Aware IM application. Highcharts have a lot of great charts and they have free version and a paid developer version which has a very good price point (390USD for 1 developer, unlimited projects, SaaS etc.). The creators of highcarts also has 2 other great libraries (stock charts and map charts).

The configuration steps here are the same as the ones for integration of Fusioncharts so if you know them, this will be easy / the same procedure. 1 additional great thing about these charts is, you can print, export to png/pdf etc. etc. directly from the chart (see screenshot below):

Highcharts demos:
http://www.highcharts.com/demo

Highcharts official site:
http://www.highcharts.com/products/highcharts

Highcharts servier side chart generation (please post how to if you manage to integrate this library with Aware IM reports):
http://www.highcharts.com/component/con ... ted-charts

Sales Funnel Example (guide below):
Image

In this example I will explain step by step how to integrate the Sales Funnel chart displayed above (other integrations i.e. other charts are just as easy). I have not included tags in this example i.e. the data in the chart is not from the actual application displaying the chart. For info on using tags, see Marks Fusioncharts guide / post.

1. Add the following to your startup.html file:
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/funnel.js"></script>
<script src="http://code.highcharts.com/modules/expo ... "></script>

2. Add the following to a single html cell in a form (you should have this html cell only and nothing else):
<div id="container" style="min-width: 800px; max-width: 800px; height: 600px; margin: 0 auto"></div>

3. Add the following js to the form "advanced script" (see Marks Fusioncharts guide if you need more info on how/where to add it):

Code: Select all

$(function () {

    $('#container').highcharts({
        chart: {
            type: 'funnel',
            marginRight: 100
        },
        title: {
            text: 'Sales funnel',
            x: -50
        },
        plotOptions: {
            series: {
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b> ({point.y:,.0f})',
                    color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black',
                    softConnector: true
                },
                neckWidth: '30%',
                neckHeight: '25%'

                //-- Other available options
                // height: pixels or percent
                // width: pixels or percent
            }
        },
        legend: {
            enabled: false
        },
        series: [{
            name: 'Unique users',
            data: [
                ['Website visits',   15654],
                ['Downloads',       4064],
                ['Requested price list', 1987],
                ['Invoice sent',    976],
                ['Finalized',    846]
            ]
        }]
    });
});
4. Open / load form to display chart.
Henrik (V8 Developer Ed. - Windows)
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

SAVE SCREEN

Post by hpl123 »

Support,
If we could expand the SAVE SCREEN action so we could save the screen of any form, this would completely solve the graphs etc. in report problem. This would enable us to use for example the highcharts mentioned in this example and also for example fusion charts and all other html etc. charts and "things" we might want to include in reports.

Hope this can be added. Thanks
Henrik (V8 Developer Ed. - Windows)
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: SAVE SCREEN

Post by hpl123 »

hpl123 wrote:Support,
If we could expand the SAVE SCREEN action so we could save the screen of any form, this would completely solve the graphs etc. in report problem. This would enable us to use for example the highcharts mentioned in this example and also for example fusion charts and all other html etc. charts and "things" we might want to include in reports.

Hope this can be added. Thanks
Thought a bit more about this idea. If this could be achieved i.e. we would have more options for the SAVE SCREEN action e.g. save a screen of a html cell in a form, this would mean, we could generate complete reports with saved screens from different html elements. This could be charts like the original thought but also other things like grids, calendars, forms and basically whatever we want (we would of course have to find a way to present what we want in a html cell first but there is a lot of great html stuff online we can use).

Just a question / disclaimer. I ASSUME the SAVE SCREEN action can be used on it´s own i.e. screens can be saved entirely via business rules? This is of course a prerequisite for these ideas.
Henrik (V8 Developer Ed. - Windows)
Rennur
Posts: 1191
Joined: Thu Mar 01, 2012 5:13 am
Location: Sydney, Australia

Post by Rennur »

Nice tip, thanks Henrik.

In regards to point #3, does the chart data have to be manually entered via Advanced script?

data: [
['Website visits', 15654],
['Downloads', 4064],
['Requested price list', 1987],
['Invoice sent', 976],
['Finalized', 846]

Can this data be accessed form an attribute?

Cheers
customaware
Posts: 2399
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Post by customaware »

It can certainly be done using an Attribute for a single value in FC Rennur. I guess the same for HC.

My intended use will be to build the entire data string in a process writing it all to a single string and then using that in the file.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Rennur
Posts: 1191
Joined: Thu Mar 01, 2012 5:13 am
Location: Sydney, Australia

Post by Rennur »

It can certainly be done using an Attribute for a single value in FC Rennur. I guess the same for HC.
My intended use will be to build the entire data string in a process writing it all to a single string and then using that in the file.
How is the data that is stored in the attribute transferred to the advanced script?

In this tip example, it is only possible by manual copy+paste i.e click Advanced button and paste the data values.
customaware
Posts: 2399
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Post by customaware »

Have a look in my example Rennur....

http://www.awareim.com/forum/viewtopic.php?t=7300

You will see in there a test value such as ....

<set label='Jan' value='<<LoggedInRegularUser.MyValue>>' />

As I mentioned....(I haven't done it yet but intend to) build the entire dataset string and assign it to LoggedInRegularUser.MyValue and then use the same way.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Rennur
Posts: 1191
Joined: Thu Mar 01, 2012 5:13 am
Location: Sydney, Australia

Post by Rennur »

Thanks for the example.

I wasn't sure if the advanced script would read <<BO.Attribute>> the same way a HTML cell does.

It looks like you've implemented this and it works; this solves my the copy+paste query.

Cheers
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Similar to what Mark mentioned:
Have a look in my example Rennur....

http://www.awareim.com/forum/viewtopic.php?t=7300

You will see in there a test value such as ....

<set label='Jan' value='<<LoggedInRegularUser.MyValue>>' />

As I mentioned....(I haven't done it yet but intend to) build the entire dataset string and assign it to LoggedInRegularUser.MyValue and then use the same way.
I wrote a Fusion Charts demo in 2009 and posted extensive demo details along with sample BSVs. Perhaps looking at the sample BSVs might help someone in creating Highcharts dynamically with AwareIM.

2009 post / sample BSV:
http://www.awareim.com/forum/viewtopic.php?t=3501
Tom - V8.8 build 3137 - MySql / PostGres
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Highcharts

Post by hpl123 »

Rennur wrote:Nice tip, thanks Henrik.

In regards to point #3, does the chart data have to be manually entered via Advanced script?

data: [
['Website visits', 15654],
['Downloads', 4064],
['Requested price list', 1987],
['Invoice sent', 976],
['Finalized', 846]

Can this data be accessed form an attribute?

Cheers
Sorry about the late reply, just got back from holiday (and I can see you figured it out). Please share a screenshot or two if you manage to implement other Highchart charts in Aware IM. Thanks
Henrik (V8 Developer Ed. - Windows)
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Using Highcharts (etc.) in Aware IM

Post by hpl123 »

Additional info.
It SEEMS as thought the Jquery library is required also to use the Highcharts charts. I apparently already had the library defined / used in my installation when I did the original post. Now when testing again it didn´t work until I added the Jquery.
Henrik (V8 Developer Ed. - Windows)
Post Reply