Compare commits
2 Commits
sriram/SQL
...
fastfrwrd/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c048b3ff6f | ||
|
|
65249a12ae |
@@ -70,8 +70,8 @@ export class UPlotAxisBuilder extends PlotConfigBuilder<AxisProps, Axis> {
|
|||||||
let {
|
let {
|
||||||
scaleKey,
|
scaleKey,
|
||||||
label,
|
label,
|
||||||
show = true,
|
|
||||||
placement = AxisPlacement.Auto,
|
placement = AxisPlacement.Auto,
|
||||||
|
show = placement !== AxisPlacement.Hidden,
|
||||||
grid = { show: true },
|
grid = { show: true },
|
||||||
ticks,
|
ticks,
|
||||||
space,
|
space,
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<{
|
|||||||
|
|
||||||
const xFieldAxisPlacement =
|
const xFieldAxisPlacement =
|
||||||
xField.config.custom?.axisPlacement !== AxisPlacement.Hidden ? AxisPlacement.Bottom : AxisPlacement.Hidden;
|
xField.config.custom?.axisPlacement !== AxisPlacement.Hidden ? AxisPlacement.Bottom : AxisPlacement.Hidden;
|
||||||
const xFieldAxisShow = xField.config.custom?.axisPlacement !== AxisPlacement.Hidden;
|
|
||||||
|
|
||||||
if (xField.type === FieldType.time) {
|
if (xField.type === FieldType.time) {
|
||||||
builder.addScale({
|
builder.addScale({
|
||||||
@@ -136,7 +135,6 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<{
|
|||||||
scaleKey: xScaleKey,
|
scaleKey: xScaleKey,
|
||||||
isTime: true,
|
isTime: true,
|
||||||
placement: xFieldAxisPlacement,
|
placement: xFieldAxisPlacement,
|
||||||
show: xFieldAxisShow,
|
|
||||||
label: xField.config.custom?.axisLabel,
|
label: xField.config.custom?.axisLabel,
|
||||||
timeZone,
|
timeZone,
|
||||||
theme,
|
theme,
|
||||||
@@ -178,7 +176,6 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<{
|
|||||||
builder.addAxis({
|
builder.addAxis({
|
||||||
scaleKey: xScaleKey,
|
scaleKey: xScaleKey,
|
||||||
placement: xFieldAxisPlacement,
|
placement: xFieldAxisPlacement,
|
||||||
show: xFieldAxisShow,
|
|
||||||
label: xField.config.custom?.axisLabel,
|
label: xField.config.custom?.axisLabel,
|
||||||
theme,
|
theme,
|
||||||
grid: { show: xField.config.custom?.axisGridShow },
|
grid: { show: xField.config.custom?.axisGridShow },
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn = ({
|
|||||||
: isHorizontal
|
: isHorizontal
|
||||||
? AxisPlacement.Bottom
|
? AxisPlacement.Bottom
|
||||||
: AxisPlacement.Left;
|
: AxisPlacement.Left;
|
||||||
const xFieldAxisShow = xField.config.custom?.axisPlacement !== AxisPlacement.Hidden;
|
|
||||||
|
|
||||||
if (xField.type === FieldType.time) {
|
if (xField.type === FieldType.time) {
|
||||||
builder.addScale({
|
builder.addScale({
|
||||||
@@ -178,7 +177,6 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn = ({
|
|||||||
scaleKey: xScaleKey,
|
scaleKey: xScaleKey,
|
||||||
isTime: true,
|
isTime: true,
|
||||||
placement: xFieldAxisPlacement,
|
placement: xFieldAxisPlacement,
|
||||||
show: xFieldAxisShow,
|
|
||||||
label: xField.config.custom?.axisLabel,
|
label: xField.config.custom?.axisLabel,
|
||||||
timeZone,
|
timeZone,
|
||||||
theme,
|
theme,
|
||||||
@@ -236,7 +234,6 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn = ({
|
|||||||
builder.addAxis({
|
builder.addAxis({
|
||||||
scaleKey: xScaleKey,
|
scaleKey: xScaleKey,
|
||||||
placement: xFieldAxisPlacement,
|
placement: xFieldAxisPlacement,
|
||||||
show: xFieldAxisShow,
|
|
||||||
label: custom?.axisLabel,
|
label: custom?.axisLabel,
|
||||||
theme,
|
theme,
|
||||||
grid: { show: custom?.axisGridShow },
|
grid: { show: custom?.axisGridShow },
|
||||||
|
|||||||
@@ -319,7 +319,6 @@ export const prepConfig = ({ series, totalSeries, color, orientation, options, t
|
|||||||
? AxisPlacement.Bottom
|
? AxisPlacement.Bottom
|
||||||
: AxisPlacement.Left
|
: AxisPlacement.Left
|
||||||
: AxisPlacement.Hidden;
|
: AxisPlacement.Hidden;
|
||||||
const xFieldAxisShow = frame.fields[0]?.config.custom?.axisPlacement !== AxisPlacement.Hidden;
|
|
||||||
|
|
||||||
builder.addAxis({
|
builder.addAxis({
|
||||||
scaleKey: 'x',
|
scaleKey: 'x',
|
||||||
@@ -335,7 +334,6 @@ export const prepConfig = ({ series, totalSeries, color, orientation, options, t
|
|||||||
gap: 15,
|
gap: 15,
|
||||||
tickLabelRotation: vizOrientation.xOri === 0 ? xTickLabelRotation * -1 : 0,
|
tickLabelRotation: vizOrientation.xOri === 0 ? xTickLabelRotation * -1 : 0,
|
||||||
theme,
|
theme,
|
||||||
show: xFieldAxisShow,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// let seriesIndex = 0;
|
// let seriesIndex = 0;
|
||||||
|
|||||||
@@ -342,7 +342,6 @@ export function prepConfig(opts: PrepConfigOpts) {
|
|||||||
|
|
||||||
builder.addAxis({
|
builder.addAxis({
|
||||||
scaleKey: yScaleKey,
|
scaleKey: yScaleKey,
|
||||||
show: yAxisConfig.axisPlacement !== AxisPlacement.Hidden,
|
|
||||||
placement: yAxisConfig.axisPlacement || AxisPlacement.Left,
|
placement: yAxisConfig.axisPlacement || AxisPlacement.Left,
|
||||||
size: yAxisConfig.axisWidth || null,
|
size: yAxisConfig.axisWidth || null,
|
||||||
label: yAxisConfig.axisLabel,
|
label: yAxisConfig.axisLabel,
|
||||||
|
|||||||
@@ -344,7 +344,6 @@ export const prepConfig = (xySeries: XYSeries[], theme: GrafanaTheme2) => {
|
|||||||
scaleKey: 'x',
|
scaleKey: 'x',
|
||||||
isTime: xIsTime,
|
isTime: xIsTime,
|
||||||
placement: customConfig?.axisPlacement !== AxisPlacement.Hidden ? AxisPlacement.Bottom : AxisPlacement.Hidden,
|
placement: customConfig?.axisPlacement !== AxisPlacement.Hidden ? AxisPlacement.Bottom : AxisPlacement.Hidden,
|
||||||
show: customConfig?.axisPlacement !== AxisPlacement.Hidden,
|
|
||||||
grid: { show: customConfig?.axisGridShow },
|
grid: { show: customConfig?.axisGridShow },
|
||||||
border: { show: customConfig?.axisBorderShow },
|
border: { show: customConfig?.axisBorderShow },
|
||||||
theme,
|
theme,
|
||||||
@@ -402,7 +401,6 @@ export const prepConfig = (xySeries: XYSeries[], theme: GrafanaTheme2) => {
|
|||||||
scaleKey,
|
scaleKey,
|
||||||
theme,
|
theme,
|
||||||
placement: customConfig?.axisPlacement === AxisPlacement.Auto ? AxisPlacement.Left : customConfig?.axisPlacement,
|
placement: customConfig?.axisPlacement === AxisPlacement.Auto ? AxisPlacement.Left : customConfig?.axisPlacement,
|
||||||
show: customConfig?.axisPlacement !== AxisPlacement.Hidden,
|
|
||||||
grid: { show: customConfig?.axisGridShow },
|
grid: { show: customConfig?.axisGridShow },
|
||||||
border: { show: customConfig?.axisBorderShow },
|
border: { show: customConfig?.axisBorderShow },
|
||||||
size: customConfig?.axisWidth,
|
size: customConfig?.axisWidth,
|
||||||
|
|||||||
Reference in New Issue
Block a user