I am trying to recreate the streamgraph ObjectiveC example from the examples page, using swift. First thing I noticed is that I can't.. and hopefully don't need to, initialize the PlotOptions style:
let plotoptions = HIPlotOptions()
plotoptions.series = HISeries()
plotoptions.series.label = HILabel()
plotoptions.series.label.minFontSize = 5
plotoptions.series.label.maxFontSize = 15
//plotoptions.series.label.style = HIStyle()
plotoptions.series.label.style.color = "rgba(255,255,255,0.75)"
because Cannot assign value of type 'HIStyle' to type 'HICSSObject?'
But more importantly, the example shows colors being assigned directly as HIColors:
HIColor *color5 = [[HIColor alloc] initWithHexValue:@"1aadce"];
HIColor *color6 = [[HIColor alloc] initWithRGBA:73 green:41 blue:112 alpha:.2];
HIColor *color7 = [[HIColor alloc] initWithRGBA:73 green:41 blue:112 alpha:.1];
But doing the equivalent, I get:
let colors: [HIColor] = [
//...
HIColor(hexValue:"1aadce"),
HIColor(rgba: 73, green: 41, blue: 112, alpha: 0.2),
HIColor(rgba: 73, green: 41, blue: 112, alpha: 0.1),
//...
Cannot assign value of type '[HIColor]' to type '[String]?'
For many of these values, its no worries .. I could just use "1aadce" .. but for the RGBA ones, how do I initialize this?
edit
I had it in reverse in the sense that it is the hex values that it cannot use, but the rgba()
values produce strings that are accepted.