Home forums Using CanvasJS Just the last Value from an cvs

This topic contains 9 replies, has 2 voices, and was last updated by  James 10 months, 4 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #18615

    James
    Member

    Hi,

    I have a cvs file with this content in one row:

    1/5/2018 17:00 55 72.1 8.36 5.6 54.6 0 0 On Off Off Off Off Off Off

    All charts are working perfect!

    But now I need only the last row from this csv.
    I would like to label each column with a final result like this:

    Date: 1/5/2018
    CCond (S11): 556
    Temp (S12): 72.1
    pH (S21): 8.36
    Retrans (A11): 5.6
    and so on

    Is there a way to do this?

    Thanks for any help

    • This topic was modified 11 months ago by  James.
    #18619

    Suyash Singh
    Participant

    James,

    Can you please explain more about your requirements, so that we can help you out better. Also, it would be great if you could:

    1. Elaborate what you mean by

    I would like to label each column with a final result like this:

    2. Provide us some pictorial representation of the chart you are looking for.

    3. Explain what all the columns in your CSV file represent.

    4. Mention the values to be represented on axis X and axis Y.

    5. Provide us some sample data points.

    ___
    Suyash Singh
    Team CanvasJS

    #18620

    James
    Member

    Hi,

    My file looks like this:

    Date Sensor (S11) Sensor Temperature (S12) Sensor (S21) FlowMeter Total (D2) Output (A1) Output (A2) CCond Temp pH Flowmeter Retrans Prop
    µS/cm °F gal % % % %
    11/16/2017 00:10:00 880 69.7 8.32 0 8.8 65.8 4 12
    11/16/2017 00:20:00 881 69.7 8.31 0 8.8 65.8 4 12
    11/16/2017 00:30:00 882 69.6 8.32 0 8.8 65.9 4 12
    11/16/2017 00:40:00 884 69.5 8.32 0 8.8 66 4 12
    …..
    ….
    11/16/2017 01:40:00 885 69.2 8.32 0 8.8 66.2 4 12

    Link to a sample CSV:

    I have a line chart for this which works perfect!

    For some kind of Dashboard, I would need only the LAST row from this file

    with all titles like “Date” “sensor (S11)” and left (Y-Axis) and only the values from the last row on the X-Axis.
    Like this:

    Date: 11/16/2017 00:10:00
    Sensor(S11): 880
    Sensor Temperature (S12): 69,9
    ..
    and so on
    ..

    I hope this helps

    #18633

    Suyash Singh
    Participant

    James,

    Are you looking for something like this? If not, please provide a representation of your requirement.
    ___
    Suyash Singh
    Team CanvasJS

    #18634

    James
    Member

    Hi Suyash,

    Thank you for all your effort!

    It is much simpler as you think. I have made a small picture how it can look:
    Sample

    I can do some styling afterward with all your tools and options.
    The most important thing is to have only the last row of data. Because I need a lot of this “widgets” in a Dashboard.
    Hope this helps to understand my needs.

    #18648

    Suyash Singh
    Participant

    James,

    Please take a look at this jsfiddle.

    ___
    Suyash Singh
    Team CanvasJS

    #18650

    James
    Member

    That’s absolutely perfect, exactly what I need.
    Thanks a lot!

    #18846

    James
    Member

    Hi,
    One problem, everything works fine as long as I use your CSV file. If I change this to one of my files I receive following error:
    Error Message

    here is my: CSV

    The difference that I see is a “carriage return” in my file after each row. I cannot change this as the CSV is generated.

    Thanks for any help!

    #18853

    Suyash Singh
    Participant

    James,

    Since your new CSV has a blank line in the end, you will either have to delete the blank line in your CSV or change the code accordingly as in this jsfiddle.

    ___
    Suyash Singh
    Team CanvasJS

    #18858

    James
    Member

    Hi Suyash,
    Thank you for the great help. I would never have this realized.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.