Converting a helper class into an Entity
Why exactly do you want to use an entity?

Entities are about CRUD. Saving, loading and deleting data in the database or somewhere else.

From looking at your code, that doesn't really seem to be what you're after, you just have an API to display some data. That's not what entities are about at all.

You could make a service of your class but that doesn't really seem to match either.

I guess the only thing that would make sense is to define it as a render element. See RenderElement and Render API overview.

So you'd define your class with @RenderElement in an Element namespace, see Link for an example. You give it a name in the annotation, like yourmodule_plot and in your render array, reference it as #type => 'yourmodule_plot' and pass the data to it like that.

A render element class basically consists of a getInfo() method that defines some default properties. In your case, that would be #theme, #attached and so on. if you need to dynamically process your data, you can add a #pre_render callback like shown in the Link example that can then process the merged array of your defaults + data you specify in the controller.