ChartGenerationAI is a project that allows you to generate Highcharts charts from a single prompt using OpenAI's API.
You can create line charts, bar charts, pie charts, bubble charts, and more by simply providing a natural language description of the chart you want.
- Clone the repository:
git clone https://github.com/RediIbra/ChartGenerationAI.git
cd ChartGenerationAI- Create an OpenAI API Key:
Follow these steps:
-
Go to OpenAI API Keys.
-
Log in with your OpenAI account.
-
Click on “Create new secret key”.
-
Copy the generated key. Keep it safe, you won’t see it again.
-
Store your API key locally using User Secrets:
dotnet user-secrets init
dotnet user-secrets set "OpenAI:ApiKey" "sk-your-api-key-here"This ensures your key is never pushed to GitHub.
- Run the project:
dotnet run- Open the application in your browser.
- Navigate to a chart page (Line, Bar, Pie, etc.).
- Enter your chart prompt in natural language.
- The app will generate the Highcharts JSON configuration and render the chart dynamically.
- Make sure
appsettings.Development.jsonis ignored in.gitignoreto avoid exposing your API key. - The project uses ASP.NET Core MVC with Highcharts for chart rendering.