Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

anychart integration query

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    anychart integration query

    Anychart is extremly powerful charting tool with responsive/modern look plus export to pdf, excel, img etc. and I want to see if this can be used in viewbox or free form.

    https://www.anychart.com/products/an...ive_Values.php
    https://www.anychart.com/features/#dashboards

    Now main question is how do I replace rows and header in alpha UX(either viewbox or free form layout using data series?
    <script type="text/javascript">
    anychart.onDocumentReady(function() {
    // create data set on our data
    chartData = {
    title: 'Top 10 Products by Profit',
    header: ['#', 'Florida', 'Texas', 'Nevada', 'Arizona'],
    rows: [
    ['Powder', 11861, 10919, -8034, 18012],
    ['Mascara', 11261, 10419, -6134, 18712],
    ['Lip gloss', 22998, 12043, 4572, -4008],
    ['Foundation', 10342, 10119, -5231, 13701],
    ['Eyeliner', 12321, 15067, 3417, -5432],
    ['Eyeshadows', 12998, 12043, -4572, -3308],
    ['Lipstick', 8814, 9054, 4376, -9256],
    ['Rouge', 11624, -7004, -3574, 5221],

    ['Eyebrow pencil', 13012, -5067, -3987, -3932],
    ['Nail polish', 12814, -3054, -4376, -4229]
    ]
    };

    #2
    Re: anychart integration query

    Don't know anything about Anychart, however, Alpha does have Google chart integration. I use it in my apps. There is a UX template if you wanted to check it out. Just a suggestion.
    Mike Brown - Contact Me
    Programmatic Technologies, LLC
    Programmatic-Technologies.com
    Independent Developer & Consultant​​

    Comment


      #3
      Re: anychart integration query

      Yes... very nice charting library. The chart Header and Data are just Arrays of data...

      Code:
      	var chartHeader = ['#', 'Florida', 'Texas', 'Nevada', 'Arizona'];
      	var rowData = [
            ['Powder', 11861, 10919, -8034, 18012],
            ['Mascara', 11261, 10419, -6134, 18712],
            ['Lip gloss', 22998, 12043, 4572, -4008],
            ['Foundation', 10342, 10119, -5231, 13701],
            ['Eyeliner', 12321, 15067, 3417, -5432],
            ['Eyeshadows', 12998, 12043, -4572, -3308],
            ['Lipstick', 8814, 9054, 4376, -9256],
            ['Rouge', 11624, -7004, -3574, 5221],
            ['Eyebrow pencil', 13012, -5067, -3987, -3932],
            ['Nail polish', 12814, -3054, -4376, -4229]
          ];
        chartData = {
          title: 'Top 10 Products by Profit',
          header: chartHeader,
          rows: rowData
        };
      chartHeader is an Array of 5 values... and rowData is an Array of 10 Values where each Value is another Array of 5 values.

      Just get your data and start building the Arrays in that format.

      Remember that running this stuff in an HTML/A5W page is one thing... but running it inside a UX may be another. You may not get AnyChart out of the box functionality... since you're now running inside a container that has it's own ideas of sizing, etc.
      Last edited by Davidk; 10-07-2017, 10:29 PM.

      Comment


        #4
        Re: anychart integration query

        Thanks Mike, David. This library comes close to tableau, powerbi in terms of features(powerful export, multilingual, 100% responsive, modern themes etc) but costs only few hundred $. I will first try it in UX and then a5w.(A5w works fine, I am trying to get alpha published data series into this)
        Last edited by amitloh; 10-08-2017, 06:45 AM.

        Comment


          #5
          Re: anychart integration query

          I am almost close!
          I was able to add anychart to viewbox very easily.

          The only issue is how to add dataseries from alpha into anychart...
          viewbox script-

          anychart.onDocumentLoad(function() {
          // create chart and set data
          var data1={dialog.object}._dataSeriesData.Series1.Population;
          alert(data1);

          var data = [
          // column name value
          {x: '2014/6/25', value: 28}, // row 0
          {x: '2014/6/26', value: 26}, // 1
          {x: '2014/6/27', value: 27}, // 2
          {x: '2014/6/28', value: 25, marker:{fill:'violet'}}, // 3
          {x: '2014/6/29', value: 29, marker:{fill:'red'}}, // 4
          {x: '2014/6/30', value: 28,} // 5
          ];


          // create a data set
          var dataSet = anychart.data.set(data);

          // create a line chart using the data set
          var lineChart = anychart.line(dataSet);

          // set container id for the chart
          lineChart.container('container');
          lineChart.title('New York weather');
          lineChart.getSeries(0).name('New York');

          // initiate chart drawing
          lineChart.draw();
          });

          Comment


            #6
            Re: anychart integration query

            they also have json-
            // create json data
            var json = {
            "chart": {
            "type": "pie",
            "data": [
            ["Product A", 1222],
            ["Product B", 2431],
            ["Product C", 3624],
            ["Product D", 5243],
            ["Product E", 8813]
            ]
            }
            };

            // create chart from json config
            var chart = anychart.fromJson(json);

            // display a chart
            chart.container('container').draw();

            Comment


              #7
              Re: anychart integration query

              I am able to get bsic chart working!

              anychart.onDocumentLoad(function() {// create json data
              var chart = anychart.fromJson({
              "chart": {
              "type": "column",
              "series":[{
              "data": {dialog.object}._dataSeriesData.Series1.Population,
              }],
              "container": "container1"
              }
              });

              chart.draw();
              });

              now I need 2 column series example-

              Comment


                #8
                Re: anychart integration query

                how to fill series like below-
                // series settings
                "series": [{
                // first series data
                "data": [
                {"x": "P1", "value": "128.14"},
                {"x": "P2", "value": "112.61"},
                {"x": "P3", "value": "163.21"},
                {"x": "P4", "value": "229.98"},
                {"x": "P5", "value": "90.54"}
                ]
                },{
                // second series data
                "data": [
                {"x": "P1", "value": "90.54"},
                {"x": "P2", "value": "104.19"},
                {"x": "P3", "value": "150.67"},
                {"x": "P4", "value": "120.43"},
                {"x": "P5", "value": "200.34"}
                ]
                }]

                Comment


                  #9
                  Re: anychart integration query

                  Hi David,

                  anychart11.zip
                  I was able to create a charting dashboard using anychart. Now I just need some guidance on how to bind this to northwind or static data series in alpha.

                  If I can achieve this then I will have enterprise database(mysql), good RAD tool-alpha and enterprise grade dashboards.

                  Untitled.png
                  Untitled.png

                  viewbox js-

                  anychart.onDocumentReady(function () {

                  // variable to help us define screen proportions
                  var flag;

                  // data for the charts
                  var drinks_data = anychart.data.set([
                  ['Cosmopolitan', 51, 45, 6, 10, 100],
                  ['Martini', 67, 39, 28, 9, 55],
                  ['Mojito', 19, 11, 8, 8, 250],
                  ['Margarita', 47, 33, 14, 9, 110],
                  ['Mai Tai', 32, 20, 12, 10, 210],
                  ['Beer', 70, 20, 50, 5, 300]
                  ]);

                  var previous_years_data = anychart.data.set([
                  ['2010', 60, 176, 35, 25],
                  ['2011', 51, 136, 25, 26],
                  ['2012', 73, 196, 35, 38],
                  ['2013', 84, 315, 43, 41],
                  ['2014', 79, 203, 36, 33],
                  ['2015', 89, 286, 41, 48]
                  ]);

                  // helper function to setup same settings for all Axis Titles
                  var setupChartAxisTitles = function (chart, titleX, titleY) {
                  chart.xAxis().labels().fontSize(11).padding([0, 0, 0, 0]);
                  chart.yAxis().labels().fontSize(11).padding([0, 0, 0, 0]);
                  if (titleX) chart.xAxis().title().enabled(true).text(titleX).fontSize(12).margin(0).padding([3, 0, 0, 0]);
                  if (titleY) chart.yAxis().title().enabled(true).text(titleY).fontSize(12).margin(0).padding([0, 0, 3, 0]);
                  };

                  // helper function to setup same settings for all Charts
                  var setupChartSettings = function (chart) {
                  chart.container(stage);
                  chart.margin(0);
                  chart.padding([15, 30, 15, 15]);
                  chart.title().fontColor('#212121').fontSize(13).padding([0, 0, 10, 0]);
                  chart.draw();
                  };

                  // create stage for all charts
                  stage = acgraph.create('container');

                  var title = anychart.standalones.title();
                  title.text('New Year Parties at ACME corp.');
                  title.background('#ffffff');
                  title.padding(10);
                  title.container(stage);
                  title.draw();

                  var pieChart = anychart.pie(drinks_data);
                  pieChart.title('Drinks');
                  pieChart.radius('40%');
                  pieChart.legend().enabled(false);
                  pieChart.labels().position('outside').fontSize(10).format(function () {
                  return this.x
                  });
                  pieChart.tooltip().format(function () {
                  return this.value + ' orders'
                  });
                  setupChartSettings(pieChart);

                  var barChart = anychart.bar();
                  barChart.title('Drinks by Gender');
                  barChart.bar(drinks_data.mapAs({'value': 3, 'x': 0})).name('Male');
                  barChart.bar(drinks_data.mapAs({'value': 2, 'x': 0})).name('Female');
                  setupChartAxisTitles(barChart, null, 'Drinks ordered');
                  setupChartSettings(barChart);

                  var scatterChart = anychart.bubble();
                  scatterChart.title('Drinks Volumne/Price Ratio');
                  var bubble_series = scatterChart.bubble(drinks_data.mapAs({'value': 4, 'x': 5, 'size': 1, 'name': 0}));
                  bubble_series.tooltip().useHtml(true).titleFormat(function () {
                  return this.getData('name')
                  }).format(function () {
                  return '<span style="font-size: 11px;">Price: $' + this.value + '<br/>Volume: ' + this.x + ' ml.<br/>Orders: ' + this.size + '</span>';
                  });
                  bubble_series.yScale()
                  .minimum(0)
                  .maximum(15);
                  setupChartAxisTitles(scatterChart, 'Volume (ml)', 'Price, $');
                  setupChartSettings(scatterChart);

                  var lineChart = anychart.line();
                  lineChart.title('Number of drinks by year');
                  lineChart.line(previous_years_data.mapAs({'value': 1, 'x': 0})).tooltip().format(function () {
                  return this.value + ' drinks'
                  });
                  setupChartAxisTitles(lineChart, null, 'Drinks ordered');
                  setupChartSettings(lineChart);

                  var areaChart = anychart.area();
                  areaChart.title('Parties Turnout');
                  areaChart.area(previous_years_data.mapAs({'value': 2, 'x': 0})).tooltip().format(function () {
                  return this.value + ' persons present'
                  });
                  setupChartAxisTitles(areaChart, null, 'Turnout');
                  setupChartSettings(areaChart);

                  var columnChart = anychart.column();
                  columnChart.title('Turnout by Gender');
                  columnChart.yAxis().title('Turnout');
                  columnChart.column(previous_years_data.mapAs({'value': 3, 'x': 0})).name('Male');
                  columnChart.column(previous_years_data.mapAs({'value': 4, 'x': 0})).name('Female');
                  setupChartAxisTitles(columnChart, null, 'Turnout');
                  setupChartSettings(columnChart);

                  // Creates general layout table with two inside layout tables
                  function configureChartsSize() {
                  if (window.innerWidth > 768) {
                  flag = 'wide';
                  pieChart.bounds(0, 30, '33.3%', '47%');
                  barChart.bounds('33.3%', 30, '33.3%', '47%');
                  scatterChart.bounds('66.6%', 30, '33.3%', '47%');
                  lineChart.bounds(0, '52%', '33.3%', '47%');
                  areaChart.bounds('33.3%', '52%', '33.3%', '47%');
                  columnChart.bounds('66.6%', '52%', '33.3%', '47%');
                  } else {
                  flag = 'slim';
                  pieChart.bounds(0, 30, '50%', '33.3%');
                  barChart.bounds('50%', 30, '50%', '33.3%');
                  scatterChart.bounds(0, '33.3%', '50%', '33.3%');
                  lineChart.bounds('50%', '33.3%', '50%', '33.3%');
                  areaChart.bounds(0, '66.6%', '50%', '33.3%');
                  columnChart.bounds('50%', '66.6%', '50%', '33.3%');
                  }
                  }

                  configureChartsSize();

                  // On resize change layout to mobile version or otherwise
                  window.onresize = function () {
                  if (flag == 'slim' && window.innerWidth > 767) {
                  configureChartsSize('wide');
                  } else if (flag == 'wide' && window.innerWidth <= 767) {
                  configureChartsSize('slim');
                  }
                  title.parentBounds(0, 0, stage.width(), 130).draw();

                  }
                  });
                  Last edited by amitloh; 10-17-2017, 08:58 AM.

                  Comment

                  Working...
                  X