ApexCharts Piechart Number to Double

I‘m having problems using the ApexCharts Piechart. The labels and the values are saved from an SQL query into a Treemap<String, Number>.
The datatypes that are in the database as also String & Number but I need a Double in the Treemap instead of a Number without changing its datatype in the DB.

(just using a Treemap witha Double instead of a Number in the resultset isn‘t working

so this isn‘t working:
ResultSet rs = statement.executeQuery(query);
while (rs.next()( {
treeMapDouble.put(rs.getString(1), rs.getDouble(2));
}
)

The PieChart code is the following

ApexChartsBuilder chartBuilder = new PieChart();
Map<String, Number> docTypes = /* Labels & Values */;
chartBuilder.withSeries(new Series<>(“DocTypes”, docTypes.values().toArray()))
.withLabels(docTypes.keySet().toArray(new String[0])).build();
ApexCharts chart = chartBuilder.build();

add(chart);

Is docTypes the same as treeMapDouble? Or how are the two snippets related?