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

LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

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

    LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

    I have a complex Oracle query that only works inside a LIST; it won't function
    inside of a data-series definition.

    Therefore I planned to:
    • Create a LIST (which works fine)
    • Populate a DATA SERIES from the LIST (which doesn't work)
    • Populate a JAVASCRIPT CHART (JS Chart) from the DATA SERIES



    I haven't been able to get this to work.

    If you have successfully employed something similar I'd love to review your method
    and take a hint or two.



    As a workaround, I have been using a variant of the process:
    • Create a LIST
    • Create a JAVASCRIPT CHART (JS Chart)
    • Populate the chart with a JAVASCRIPT FUNCTION that pulls data from the LIST
    • But... there are challenges with picking picking up the LIST data as an object so I've had to pick it up as a string and then attempt to convert it using JSON.PARSE().



    Thanks for taking a look.
    Last edited by parkjammer; 07-26-2017, 12:44 PM.

    #2
    Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

    Originally posted by parkjammer View Post
    I have a complex Oracle query that only works inside a LIST; it won't function
    inside of a data-series definition.

    Therefore I planned to:
    • Create a LIST (which works fine)
    • Populate a DATA SERIES from the LIST (which doesn't work)
    • Populate a JAVASCRIPT CHART (JS Chart) from the DATA SERIES



    I haven't been able to get this to work.

    If you have successfully employed something similar I'd love to review your method
    and take a hint or two.



    As a workaround, I have been using variant of the process:
    • Create a LIST
    • Create a JAVASCRIPT CHART (JS Chart)
    • Populate the chart with a JAVASCRIPT FUNCTION that pulls data from the LIST
    • But... there are challenges with picking picking up the LIST data as an object so I've had to pick it up as a string and then attempt to convert it using JSON.PARSE().



    Thanks for taking a look.
    Hello Allan,

    The Data Series is a server-side feature, populated on the server and sent to the client. To use a Data Series in a Javascript Chart, the Data Series must be published client side. This is done by checking a box at the bottom of the Data Series Dialog.

    What is it about your query that it cannot be used to define a Data Series and needs to be put in a List control? If the query requires a custom query or a stored procedure, the Data Series can be defined using a "custom" definition using Xbasic. A custom SQL query can also be specified for the SQL data source definition for a Data Series.

    The second procedure you have outlined is the recommended method for populating a Javascript Chart using data in a List control. You mention issues using the list's data object that requires using JSON.parse(). Could you be more specific?

    Thanks
    Sarah Mitchell
    Director of Customer Success | [URL="https://www.alphasoftware.com"]Alpha Software Corporation[/URL]
    [B]Get in the know! [/B] Join us for our Weekly Webinars: [URL="https://www.alphasoftware.com/weekly-transform-tuesday-webinar"]TransForm Tuesday[/URL] and [URL="https://www.alphasoftware.com/weekly-alpha-anywhere-overview-webinar"]Wednesday's Alpha Anywhere Demo and Q&A[/URL]
    Connect with us: [URL="https://www.instagram.com/alpha_software_corp/"]Instagram[/URL] | [URL="https://twitter.com/AlphaSoftware"]Twitter[/URL] | [URL="https://www.facebook.com/AlphaSoftware/"]Facebook[/URL] | [URL="https://www.linkedin.com/company/alpha-software"]LinkedIn[/URL] | [URL="https://www.youtube.com/user/AlphaSoftwareInc"]YouTube[/URL]

    Comment


      #3
      Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

      .
      .

      WARNING:
      The problem arises from lengthy SQL statements and interactions between LISTS, DATA SERIES, and JAVASCRIPT CHARTS. It is therefore quite long. Doing my best to make it clear.
      Video A screencast video walking through from the original problem to an eventual solution (however over-wrought) can be seen here.

      It's 15 minutes long and you can see the successful result if you go to the 13:38 mark.

      SCREENCAST: A5_Issue_-_complex_Oracle_SQL_in_LIST


      Sara, thanks for your response.

      There are three related issues. They are difficult to reproduce unless you have a
      fairly involved (though not unusual) SQL statement on an Oracle database.

      The issues are:

      1. It can be necessary to "wrap" a complex Oracle SQL statement in a more simple form in order it to run within the LIST
      2. Using NATIVE SQL in a DATA SERIES definition... apparently you can't do this; neither has populating the data-series from a list worked.
      3. When using the javascript-function technique to populate a JS Chart the resulting data-object isn't feeding the chart properly


      Issue #1: complex Oracle SQL statement

      Generic SQL statement
      (works fine usually but will fail for complex Oracle statements)
      Code:
      [COLOR="#0033cc"]
      [B]SELECT[/B]
            field_1
          , field_2
          , field_3
      [B]FROM[/B]
            Table_A
          , Table_B
          , Table_C
      [B]WHERE[/B]
          Table_A.id_field = Table_B.id_field
          and
          Table_B.id_field = Table_C.id_field
      [/COLOR]
      WRAPPED
      (Make the original query into a sub-query, wrap it in a simple SELECT, then LIST and field visibility/selection will work)
      Code:
      [COLOR="#FF0000"]
      SELECT
            TabSUB.field_1
          , TabSUB.field_2
          , TabSUB.field_3
      FROM
      (
      [COLOR="#0033cc"]
          [B]SELECT[/B]
                field_1
              , field_2
              , field_3
          [B]FROM[/B]
                Table_A
              , Table_B
              , Table_C
          [B]WHERE[/B]
              Table_A.id_field = Table_B.id_field
              and
             Table_B.id_field = Table_C.id_field
      [/COLOR]
      ) [B]TabSUB[/B]
      ORDER BY
        1, 2, 3
      [/COLOR]
      ERROR: Desired Query
      (note)

      Code:
          SELECT 
              sales_date                                  as SALESDATE
            , round(sum(TabSD.actual_quantity), 2)        as HISTORY 
            , round(sum(decode(TabSD.enter_fore,NULL,(nvl(TabSD.col_for_over,(((nvl(TabSD.manual_stat,nvl(TabSD.sim_val_1,TabSD.Fore_4)) * (1.00 - nvl(decode(TabSD.trg_cannizn_perc,1,TabSD.trg_cannizn_perc,0),0)) * (1.00 - nvl(TabSD.src_cannizn_perc,0))*(1.00+nvl(TabSD.manual_fact,0))+nvl(TabSD.fixed_prom,0))*(1-nvl(TabSD.rule_coll,0)))+(nvl(TabSD.int_cost,0)*nvl(TabSD.rule_coll,0))))),TabSD.ff)*1), 2) as FORECAST  
            , min(add_months(TabSP.Max_Sales_Date,-12))   as DATERANGE_START
            , max(add_months(TabSP.Max_Sales_Date, 12))   as DATERANGE_END
          FROM 
              SALES_DATA TabSD
            , ITEMS TabI
            , T_EP_ITEM TabTEI
            , LOCATION TabL
            , T_EP_SITE TabTES
            , MDP_MATRIX TabMDP
            , T_EP_ORGANIZATION TabTEO
            , (select to_date(substr(pval,1,10), 'MM-DD-YYYY') as Max_Sales_Date from sys_params where upper(pname) like upper('MAX_SALES_DATE')) TabSP
          WHERE 
                TabSD.item_id = TabI.item_id 
            AND TabI.t_ep_item_ep_id = TabTEI.t_ep_item_ep_id 
            AND TabL.t_ep_site_ep_id = TabTES.t_ep_site_ep_id 
            AND TabSD.location_id = TabL.location_id 
            AND TabSD.location_ID = TabMDP.location_id 
            AND TabSD.item_ID = TabMDP.item_id 
            AND TabMDP.t_ep_organization_ep_id = TabTEO.t_ep_organization_ep_id 
            AND ( upper(TabTEI.ITEM) like upper('101STMS0285 400A') )
            AND TabSD.sales_date >= (add_months(TabSP.Max_Sales_Date,-12))
            AND TabSD.sales_date <  (add_months(TabSP.Max_Sales_Date, 12))
            AND (
                  round(TabSD.actual_quantity,2) > 0 
                  OR 
                  round((decode(TabSD.enter_fore,NULL,(nvl(TabSD.col_for_over,(((nvl(TabSD.manual_stat,nvl(TabSD.sim_val_1,TabSD.Fore_4)) * (1.00 - nvl(decode(TabSD.trg_cannizn_perc,1,TabSD.trg_cannizn_perc,0),0)) * (1.00 - nvl(TabSD.src_cannizn_perc,0))*(1.00+nvl(TabSD.manual_fact,0))+nvl(TabSD.fixed_prom,0))*(1-nvl(TabSD.rule_coll,0)))+(nvl(TabSD.int_cost,0)*nvl(TabSD.rule_coll,0))))),TabSD.ff)*1),2) > 0 
                ) 
          GROUP BY 
            sales_date
      ADJUSTED: seems to fix the problem... but why?
      (note)
      Code:
      [COLOR="#FF0000"]
      SELECT
          TabSUB.SALESDATE
        , TabCLDR.DATET
        , nvl(TabSUB.HISTORY,0) as HISTORY
        , nvl(TabSUB.FORECAST,0) as FORECAST 
        , TabSUB.DATERANGE_START
        , TabSUB.DATERANGE_END
      FROM 
        (
      [COLOR="#0033cc"]
          SELECT 
              sales_date                                  as SALESDATE
            , round(sum(TabSD.actual_quantity), 2)        as HISTORY 
            , round(sum(decode(TabSD.enter_fore,NULL,(nvl(TabSD.col_for_over,(((nvl(TabSD.manual_stat,nvl(TabSD.sim_val_1,TabSD.Fore_4)) * (1.00 - nvl(decode(TabSD.trg_cannizn_perc,1,TabSD.trg_cannizn_perc,0),0)) * (1.00 - nvl(TabSD.src_cannizn_perc,0))*(1.00+nvl(TabSD.manual_fact,0))+nvl(TabSD.fixed_prom,0))*(1-nvl(TabSD.rule_coll,0)))+(nvl(TabSD.int_cost,0)*nvl(TabSD.rule_coll,0))))),TabSD.ff)*1), 2) as FORECAST  
            , min(add_months(TabSP.Max_Sales_Date,-12))   as DATERANGE_START
            , max(add_months(TabSP.Max_Sales_Date, 12))   as DATERANGE_END
          FROM 
              SALES_DATA TabSD
            , ITEMS TabI
            , T_EP_ITEM TabTEI
            , LOCATION TabL
            , T_EP_SITE TabTES
            , MDP_MATRIX TabMDP
            , T_EP_ORGANIZATION TabTEO
            , (select to_date(substr(pval,1,10), 'MM-DD-YYYY') as Max_Sales_Date from sys_params where upper(pname) like upper('MAX_SALES_DATE')) TabSP
          WHERE 
                TabSD.item_id = TabI.item_id 
            AND TabI.t_ep_item_ep_id = TabTEI.t_ep_item_ep_id 
            AND TabL.t_ep_site_ep_id = TabTES.t_ep_site_ep_id 
            AND TabSD.location_id = TabL.location_id 
            AND TabSD.location_ID = TabMDP.location_id 
            AND TabSD.item_ID = TabMDP.item_id 
            AND TabMDP.t_ep_organization_ep_id = TabTEO.t_ep_organization_ep_id 
            AND ( upper(TabTEI.ITEM) like upper('101STMS0285 400A') )
            AND TabSD.sales_date >= (add_months(TabSP.Max_Sales_Date,-12))
            AND TabSD.sales_date <  (add_months(TabSP.Max_Sales_Date, 12))
            AND (
                  round(TabSD.actual_quantity,2) > 0 
                  OR 
                  round((decode(TabSD.enter_fore,NULL,(nvl(TabSD.col_for_over,(((nvl(TabSD.manual_stat,nvl(TabSD.sim_val_1,TabSD.Fore_4)) * (1.00 - nvl(decode(TabSD.trg_cannizn_perc,1,TabSD.trg_cannizn_perc,0),0)) * (1.00 - nvl(TabSD.src_cannizn_perc,0))*(1.00+nvl(TabSD.manual_fact,0))+nvl(TabSD.fixed_prom,0))*(1-nvl(TabSD.rule_coll,0)))+(nvl(TabSD.int_cost,0)*nvl(TabSD.rule_coll,0))))),TabSD.ff)*1),2) > 0 
                ) 
          GROUP BY 
            sales_date
        ) TabSUB
      [/COLOR]
        RIGHT OUTER JOIN INPUTS TabCLDR
          ON TabSUB.SALESDATE = TabCLDR.DATET
      WHERE
        TabSUB.SALESDATE = TABCLDR.DATET
      ORDER BY
        TabCLDR.DateT
      [/COLOR]


      Issue #2: data-series populated via NATIVE SQL
      • No detail here... just doesn't seem to be possible with NATIVE SQL
      • Have attempted to populate from a proper LIST but this hasn't worked either

      Issue #3: populating a JS Chart from a LIST
      • Used examples from the available JS Chart videos
      • Augmented with examples from the forum and general net searches
      • However... the resulting object variable does not feed the scatter chart properly
      • Had to loop through the object and compose it as a string
      • Then covert the string back to an object using JSON.PARSE()
      • Finally got it to work... but clearly there must be an easier method.

      Javascript that doesn't work
      (Clearly some kind of array/object definition issue)

      Code:
      function js_ListData_History_2() {
      
      	// Pick up the control ID (a LIST)
          var lObj = {dialog.object}.getControl('N1L1P2_LST1');
          
      	// Get the data from the LIST 
          var _d = lObj._data
          
          // Define an empty array
          var _a = [];
          
          // Pull the content of a list and put it in an array
          for(var i = 0; i < _d.length; i++) {
      
      		// Compose date into YYYY/MM/DD format 
              _a.push('{"x":' + '"' + _d[i].SALESDATE.substring(6,10) + '-' + _d[i].SALESDATE.substring(0,2) + '-' + _d[i].SALESDATE.substring(3,5) + "T00:00:00.000Z" + '"' + ', "y":' + _d[i].HISTORY +'}'); 
      
          };
      
      	// Test line
      	document.getElementById('N1L3P2_DIV1').innerHTML = _a;
      
          return _a;
      }
      Javascript that DOES WORK
      (Granted, it's a fairly convoluted way to get it to work)

      Code:
      
      function js_ListData_History_4() {
      	
      	// Pick up the control ID (a LIST)
          var lObj = {dialog.object}.getControl('N1L1P2_LST1');
          
      	// Get the data from the LIST 
          var _d = lObj._data
          
          // Define an empty array
          var _a = [];
          
      	// Define an object to hold dynamically gathered data from LIST
          var vl_data_dynamic;
      
      	// Define a string for JSON content assembly
      	var vl_json_content = "";
      
          // Pull the content of a list and put in a JSON compliant string for later conversion to an object
          // for(var i = 0; i < 1; i++) {
          for(var i = 0; i < _d.length; i++) {
      
      		// Compose date into YYYY/MM/DD format 
              vl_json_content = vl_json_content + '{"x":' + '"' + _d[i].SALESDATE.substring(6,10) + '-' + _d[i].SALESDATE.substring(0,2) + '-' + _d[i].SALESDATE.substring(3,5) + '"' + ', "y":' + _d[i].HISTORY +'}'; 
      
      		// Sample JSON PARSE date format:       2016-04-26T18:09:16Z        
      		if (i < ( _d.length) - 1 ) {
                vl_json_content = vl_json_content + ", ";
      		};        
          };
      
      	// Add bounding single-quotes
      	vl_json_content = '[' + vl_json_content + ']';
      
      
      	// Test alert
      	//alert(vl_json_content);
      	
        
      	// The array does not work on its own; it appears to need conversion to an object
      	vl_data_dynamic = JSON.parse(vl_json_content); 
      	
      		
      	// Test line
      	document.getElementById('N1L3P2_DIV1').innerHTML = vl_data_dynamic;
      
          return vl_data_dynamic;
      }
      Last edited by parkjammer; 07-26-2017, 08:58 AM. Reason: Previously incomplete

      Comment


        #4
        Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

        Well Sarah, thats as specific as it comes. Allan, these are issues that have driven me crazy over the years, I just never had the skill to do what you just did, and Sarah, if Allan is not on the consultative review team of Alpha (if it even exists and if it doesn't, it should) and if he's not it, he should be.

        Allan, I can't thank you enough for this presentation but you will get a request to submit a test case to fix it...

        Great work, thanks man.

        Pete
        Insanity: doing the same thing over and over again and expecting different results.
        Albert Einstein, (attributed)
        US (German-born) physicist (1879 - 1955)

        Comment


          #5
          Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

          Thanks Pete.

          I have had 50+ of these types of issues since I started working with Alpha. I remain
          impressed with many of Alpha's capabilities and its promise... but often have wondered
          if I'm missing an "Alpha gene" somewhere that makes this stuff smooth and easy.

          Perhaps I'm not entirely nuts...

          :-)

          Comment


            #6
            Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

            Same, Allen's work is a relief for me as well. Hope it gets a result.
            Insanity: doing the same thing over and over again and expecting different results.
            Albert Einstein, (attributed)
            US (German-born) physicist (1879 - 1955)

            Comment


              #7
              Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

              When I hit this type of problem in Alpha I tend to try something else. While I don't fully understand the problem I was wondering if you could build a Google chart server-side. Selwyn has an excellent video. UX_V12_86 the first of 3 is http://www.ajaxvideotutorials.com/V1...tingData_1.swf

              Comment


                #8
                Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

                Well thats how I ended up doing via the List Control.
                Insanity: doing the same thing over and over again and expecting different results.
                Albert Einstein, (attributed)
                US (German-born) physicist (1879 - 1955)

                Comment


                  #9
                  Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

                  Michael,

                  It's a fair question.

                  I've built fairly complex UX components in the past involving lists, charts, data-series, maps, etc.

                  At the time I used a server-side set of SQL and PL/SQL constructs to "pre-aggregate" the data. That is, the complex Oracle SQL was being executed by an external process and a single table was the result.

                  A LIST or a DATA-SERIES has no problem picking up data from the resulting single table. It's a simple SQL statement.

                  The problem is that the data is refreshed only once or twice a day from the complex query into the single resultant table. That isn't good enough for my present needs.

                  As a result, a more complex Oracle SQL query needs to be executed from the LIST or from a DATA-SERIES in order to feed a chart (server-side or client-side).

                  This leads to three problems:
                  1. LISTs have challenges with complex Oracle SQL queries (see "sub-query" reference in prior note)
                  2. DATA-SERIES do not seem to be able to handle complex Oracle SQL queries at all
                  3. When a LIST can be made to perform the query, there are issues in feeding the data to a JS CHART or to a DATA-SERIES


                  So I made it work using a workaround that took me many hours to figure out.

                  It seems likely there is a proper way to do it that is more straight forward and that's what I'm looking for now.

                  Cheers!

                  Comment


                    #10
                    Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

                    Michael,

                    Thanks for the video reference. I've searched for and watched many videos; I didn't watch this one before (I watched the others about using Javascript Charts, using javascript to populate them with SQL data, using data-series drawn from SQL-data, etc). As a note, the link you included launches a downloaded version of the file that I can't run (no flash components any longer). The YouTube reference is:

                    Alpha Anywhere Google chart getting data Part 1, 2 and 3
                    |
                    |
                    |-- https://www.youtube.com/watch?v=3Rdf1SEKg_Q
                    |
                    |-- Uses server-side XBASIC to query a database with SQL
                    |-- Delivers the result as javascript and JSON to the client-side UX



                    The one challenge with this method is that it's one-way; the data goes from SQL to the chart.

                    If I want two-way interaction (view, edit, save) then I need a LIST to view/edit/save data and a CHART that draws from the LIST.

                    Could I write this all as custom lists, forms, javascript, and xbasic? Of course. But that entirely defeats the purpose fo a RAD tool that is intended to be "low code".

                    On the whole I find almost everything I've ever tried to do with Alpha has required getting 80% there with some pre-built module and then building the remaining 20% with raw code. The problem is that the latter 20% of code took 80% of the time.

                    Onwards...

                    Originally posted by Michael1954 View Post
                    When I hit this type of problem in Alpha I tend to try something else. While I don't fully understand the problem I was wondering if you could build a Google chart server-side. Selwyn has an excellent video. UX_V12_86 the first of 3 is http://www.ajaxvideotutorials.com/V1...tingData_1.swf

                    Comment


                      #11
                      Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

                      If I want two-way interaction (view, edit, save) then I need a LIST to view/edit/save data and a CHART that draws from the LIST.
                      The method outlined requires a visit to the server. So after saving you just redraw the list.

                      I have an offline list that I edit, I can loop through the list very easily and use it as a data source. Our lists are virtualised and about 7,500 lines. It is acceptable from a speed point of view but it is not "quick". My point is you can use the list as a data source and build arrays. These arrays can be displayed as graphs with Rgraph.

                      Comment


                        #12
                        Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

                        Michael,

                        I'm aware that populating, refreshing, or saving contents from a LIST requires a call to the server.

                        The video referenced in the prior thread is certainly a good and helpful video for pulling SQL data
                        on the server side and delivering it to a data-series or chart. It does not provide a method for
                        making changes and saving them back.

                        Using a LIST isn't the only method for two-way (view & edit) of data but it certainly exists for that
                        purpose and ideally should be plug-n-play.

                        As noted prior, my challenges have been:

                        • Getting complex Oracle SQL queries to work inside of a LIST (there appears to a flaw in the Alpha interface)
                        • Getting the data from a LIST smoothly to a JS Chart (Rgraph), specifically a date-centric scatter diagram.
                          • Assigning the LIST content to an OBJECT using the alpha methods does not produce a result that can easily be fed to the javascript chart (or so it seems)
                          • so I had to convert it to a string and map it back to an OBJECT (not an ARRAY OBJECT)
                          • It took me a long while to sort this out.



                        So do I have a solution? Well, it works.

                        It's just that I figure there should have been a better, simpler, and more obvious way to achieve this end.

                        If you are taking data directly from a LIST (specifically a DATE-centric data set) and populating a JS CHART then I'd be curious to see the javascript function you are using to do that.

                        Thanks for taking a moment to look!


                        Originally posted by Michael1954 View Post
                        The method outlined requires a visit to the server. So after saving you just redraw the list.

                        I have an offline list that I edit, I can loop through the list very easily and use it as a data source. Our lists are virtualised and about 7,500 lines. It is acceptable from a speed point of view but it is not "quick". My point is you can use the list as a data source and build arrays. These arrays can be displayed as graphs with Rgraph.

                        Comment


                          #13
                          Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

                          Hi,

                          I too have had issues with using native queries when attempting to use Oracle, (we use lots of package based functions within sql here). I find creating the query as a view on the database, then referring to that gets around those problems.

                          Comment


                            #14
                            Re: LIST as a data source for JAVASCRIPT CHARTS (JS Charts)

                            Thanks for the note.

                            I've resolved to use interim tables (SQL to interim-table, allow quick view/edit, then use procedures and MERGE statements to save the data back... it is aggregated data and required proportioning).

                            Comment

                            Working...
                            X