Chart Generator API - Ruby Gem
Chart Generator creates beautiful chart images from your data. Supports bar, line, pie, doughnut, radar, and polar area charts with customizable styling.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_chartgenerator'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_chartgenerator
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_chartgenerator'
# Initialize the client
client = APIVerve::Chartgenerator::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({
type: "bar",
labels: Q1,Q2,Q3,Q4,
datasets: [object Object],[object Object],
title: "Quarterly Report"
})
# Print the response
puts response
Error Handling
begin
response = client.execute({ type: "bar", labels: Q1,Q2,Q3,Q4, datasets: [object Object],[object Object], title: "Quarterly Report" })
puts response["data"]
rescue APIVerve::Chartgenerator::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Chartgenerator::APIError => e
puts "API error: #{e.message}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Chartgenerator::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"id": "6a783c9c-f959-4a88-80cb-84580b8c788d",
"format": ".png",
"expires": 1766010059346,
"type": "bar",
"downloadURL": "https://storage.googleapis.com/apiverve/APIData/chartgenerator/6a783c9c-f959-4a88-80cb-84580b8c788d.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1766010059&Signature=Iud%2B7hoPRtPbWoJXQAAnhN9nqUHObHQ7PaiJCtkWQzEzpMexPMRR3BIPKkwOUMAwT6YcNbvywgnLvU2SV7498rbp%2FZbktuAR3Ok1E3O6p4ZJJ4s%2FpW8HAZgIBJpDlPUQt%2FjulQLtwP2I2GUPVmgWheXitnWsWq1S3E2k4viysXwS8H2%2B8BBdxjS%2Bv1ruGXbqd4RpdzdLst4e9YtHGWNZuiaL8zX8%2FHA1zreyrewY2fpB4g0pHnh%2B3IDE48eIohb4HQoDc9vXy4s8sIoqLScmTLyxyq1pPYlak1n1PWdbLcz4TBr41JnLELzF%2BBwCkyrLts9dhisSseaIB7d4g4JQnw%3D%3D"
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://chartgenerator.apiverve.com?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.