Display payload from API into chart

Hello, I am querying an external API and for financial information. This is the kind of payload it returns:

[
  metricData: %{
    "metrics" => ["Metric1", "Metric2", "Metric3"],
    "series" => [
      %{"time" => "2009-01-03T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-04T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-05T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-06T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-07T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-08T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-09T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-10T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-11T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-12T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-13T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-14T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-15T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-16T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-17T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-18T00:00:00.000Z", "values" => [nil, nil, "0.0"]},
      %{"time" => "2009-01-19T00:00:00.000Z", "values" => [nil, nil, "0.0"]},

I am unfamiliar with financial information. How do I turn this into something I can display? (PS values are changed for privacy reasons.)

I’d like to turn this into a chart :slight_smile:

@elcritch has put together a plotting package capable of handling time series data: https://github.com/elcritch/plotex

1 Like

This looks promising as well. https://github.com/buren/chartkick-ex. This is my first time using any kind of chart so any suggestions are very welcome!

@elcritch also has a sample project that should give you enough to base yours on: https://github.com/elcritch/plotex_liveview_example

2 Likes