I'm trying to use TChar + TBarSeries to display a colormap-indicator much like octaves 'colorbar' command does. The following example uses the 'jet' colormap (but I need to use others too): 1.
First thing is, that using GDI no Gradient with more then 3 interpolation points seems to be drawn (seems to be a bug).
I can't use GDI+ (for compatibility issues) so I would need that feature working for GDI.
2.
Regardless of the rendering mode the Gradient seems not to respect the Gradients 'EndColor': As you can see the Top color (see red arrow) and the color on the 'End...' button seems to be some sort of blue but I had set it to dark red in the gradient construction window (see image).
If I set that color again the button shows it for a moment: but as soon as you move the mouse over that button the color gets blueish again (the BarSeries never changes).
Same behaviour if you use one of the 'Default' colormaps and with any EndColor in GDI-Mode too.
You can paste the following to an empty Form to get the bar (its a simplified colormap). Also after pasting it, you need to go to the series Data Source - page and change the number of samples to 1 (number of samples seems not to get stored in the dfm):
Code: Select all
object CMapChart: TChart
Left = 456
Top = 8
Width = 105
Height = 396
AllowPanning = pmNone
BackWall.Brush.Gradient.Direction = gdBottomTop
BackWall.Brush.Gradient.EndColor = clWhite
BackWall.Brush.Gradient.StartColor = 15395562
BackWall.Brush.Gradient.Visible = True
BackWall.Transparent = False
Foot.Font.Color = clBlue
Foot.Font.Name = 'Verdana'
Gradient.Direction = gdBottomTop
Gradient.EndColor = clWhite
Gradient.MidColor = 15395562
Gradient.StartColor = 15395562
Gradient.Visible = True
LeftWall.Color = 14745599
Legend.Font.Name = 'Verdana'
Legend.Shadow.Transparency = 0
Legend.Symbol.Gradient.EndColor = 10708548
Legend.Visible = False
RightWall.Color = 14745599
Title.Font.Name = 'Verdana'
Title.Text.Strings = (
'TChart')
Title.Visible = False
BottomAxis.Axis.Color = 4210752
BottomAxis.Axis.Visible = False
BottomAxis.Grid.Color = 11119017
BottomAxis.LabelsFormat.Font.Name = 'Verdana'
BottomAxis.TicksInner.Color = 11119017
BottomAxis.Title.Font.Name = 'Verdana'
BottomAxis.Visible = False
DepthAxis.Axis.Color = 4210752
DepthAxis.Grid.Color = 11119017
DepthAxis.LabelsFormat.Font.Name = 'Verdana'
DepthAxis.TicksInner.Color = 11119017
DepthAxis.Title.Font.Name = 'Verdana'
DepthTopAxis.Axis.Color = 4210752
DepthTopAxis.Grid.Color = 11119017
DepthTopAxis.LabelsFormat.Font.Name = 'Verdana'
DepthTopAxis.TicksInner.Color = 11119017
DepthTopAxis.Title.Font.Name = 'Verdana'
LeftAxis.Axis.Color = 4210752
LeftAxis.Grid.Color = 11119017
LeftAxis.LabelsFormat.Font.Name = 'Verdana'
LeftAxis.TicksInner.Color = 11119017
LeftAxis.Title.Font.Name = 'Verdana'
Panning.MouseWheel = pmwNone
RightAxis.Axis.Color = 4210752
RightAxis.Grid.Color = 11119017
RightAxis.LabelsFormat.Font.Name = 'Verdana'
RightAxis.TicksInner.Color = 11119017
RightAxis.Title.Font.Name = 'Verdana'
TopAxis.Axis.Color = 4210752
TopAxis.Grid.Color = 11119017
TopAxis.LabelsFormat.Font.Name = 'Verdana'
TopAxis.TicksInner.Color = 11119017
TopAxis.Title.Font.Name = 'Verdana'
View3D = False
View3DWalls = False
Zoom.Allow = False
TabOrder = 5
DefaultCanvas = 'TGDIPlusCanvas'
ColorPaletteIndex = 13
object CMapSeries: TBarSeries
BarBrush.Gradient.Colors = <
item
Color = 7798784
end
item
Color = clAqua
Offset = 0.266467065868263500
end
item
Color = clYellow
Offset = 0.511976047904191600
end
item
Color = clRed
Offset = 0.745508982035928200
end
item
Color = 10708548
Offset = 1.000000000000000000
end>
BarBrush.Gradient.EndColor = 10708548
BarBrush.Gradient.MidColor = clAqua
BarBrush.Gradient.StartColor = 7798784
BarBrush.Gradient.Visible = True
Marks.Visible = False
BarWidthPercent = 100
Gradient.Colors = <
item
Color = 7798784
end
item
Color = clAqua
Offset = 0.266467065868263500
end
item
Color = clYellow
Offset = 0.511976047904191600
end
item
Color = clRed
Offset = 0.745508982035928200
end
item
Color = 10708548
Offset = 1.000000000000000000
end>
Gradient.EndColor = 10708548
Gradient.MidColor = clAqua
Gradient.StartColor = 7798784
Gradient.Visible = True
GradientRelative = True
SideMargins = False
XValues.Name = 'X'
XValues.Order = loAscending
YValues.Name = 'Bar'
YValues.Order = loNone
end
end