You need to sign in to do that
Don't have an account?
Parsing and Plotting
Ok. So here is what I am trying to do. I have received two different fields that contain the information for plot points on a scatter graph. They are in Long text fields and seperated by 1 space:
ex:
Channel Flow : 00.123456 00.123457 00.123458 etc...
Channel Volume: -00.987654 -00.987653 -00.987652 etc...
What I need to do is three fold:
1) I need to split these values
2) I need to convert the values into decimals
3) I need to plot Channel Volume vs. Channel Flow on a graph
I am using google visualizations and at this point I feel like I am lost. The starting of my code is below:
public String getTimeVolume(List<Id> ids){ GoogleViz gv = new GoogleViz(); gv.cols = new list<GoogleViz.col> { new GoogleViz.Col('col2','Interval','number'), new GoogleViz.Col('col1','Channel Volume','number') }; decimal interval = 0; for(Trial__c tfv : [Select Id, Channel_Volume__c from Trial__c]) { Integer v; List<String> cv = tfv.Channel_Volume__c.split(' '); for(v = 0; v < cv.count; v++) { GoogleViz.row r = new GoogleViz.row(); r.cells.add ( new GoogleViz.cell( interval));//interval r.cells.add ( new GoogleViz.cell( tfv.Channel_Volume__c[v]));//X-Axis gv.addRow( r ); interval = interval + .01; } }
I feel like I am on the rigth track, but am missing something. Currently the error that compiling is producing is:
Expresssion must be a list type: String
So here was the final code that worked for this solution:
All Answers
should be:
That solved one issue, now I am receiving the following:
Save Error: Method does not exist or incorrect signature: [List<String>].count()
I am trying to count the amount of values to iterate through on teh for loop. Is there a better way to do this?
JP
So now I have changed the code to below and am getting the error:
constructor not defined: [GoogleViz.cell].<Constructor>(List<String>)
any suggestions?
So here was the final code that worked for this solution: