How to force x-axis frequency and x-axis value in time series

Hi, I’m trying to retrieve data mapped to datas from a database.

But the panel is setting the x-axis frequency to 2 days. I want to set frequency to 1 days.
Below is the current state.
image

And I’d like the x-axis data to still be fully visible even when attempting to reduce the size of panel.
For example, on the website, even when reducing the panel size, the x-axis values remain intact. However, despite using the same version, the x-axis values disappear for me… Below is the current state.
image

  • What Grafana version and what operating system are you using?
    Grafana v11.0.0-67578 (main)
    or Grafana v10.4.2 (latest)

Hey @yongyongsi, welcome to the forum.

Can you share the Axis parameters of your panel?

Regards

Hi, Thanks to the response!

My Axis Parameters are as follows.

If you need more information, let me know. :grin:

One workaround could be:
Keep in mind that by default (and I don’t know how to change that) the x-axis is auto-scaling depending of the time range you have. So the solution could basically be to change your time range. If you still want to keep your previous time range for the others panel, I assume you can modify the selecting time range in your query (this might display weird result).


Concerning your issue about the legend disappearing with a small panel:
If you reduce too much your panel there’ll be no space to display anything at all, so the legend disappear.
I tried with the example your provided and it disappear as well. Maybe I misunderstood your problem?

I could see that the x-axis is always displayed on the website I provided as an example.
Seeing this, I thought it could be fixed.
Do you happen to know how to maintain it like this?

I’m attaching a screenshot of the screen I’m looking at.

image

{
  "datasource": {
    "type": "graphite",
    "uid": "000000001"
  },
  "description": "",
  "fieldConfig": {
    "defaults": {
      "custom": {
        "drawStyle": "line",
        "lineInterpolation": "smooth",
        "barAlignment": 0,
        "lineWidth": 2,
        "fillOpacity": 40,
        "gradientMode": "opacity",
        "spanNulls": true,
        "insertNulls": false,
        "showPoints": "never",
        "pointSize": 5,
        "stacking": {
          "mode": "none",
          "group": "A"
        },
        "axisPlacement": "auto",
        "axisLabel": "",
        "axisColorMode": "text",
        "axisBorderShow": false,
        "scaleDistribution": {
          "type": "linear"
        },
        "axisCenteredZero": false,
        "hideFrom": {
          "tooltip": false,
          "viz": false,
          "legend": false,
          "graph": false
        },
        "thresholdsStyle": {
          "mode": "off"
        }
      },
      "color": {
        "mode": "palette-classic"
      },
      "mappings": [],
      "thresholds": {
        "mode": "absolute",
        "steps": [
          {
            "color": "green",
            "value": null
          },
          {
            "color": "red",
            "value": 80
          }
        ]
      },
      "unit": "short"
    },
    "overrides": [
      {
        "matcher": {
          "id": "byName",
          "options": "backend_01"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "purple",
              "mode": "palette-classic"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "backend_02"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "green",
              "mode": "palette-classic"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "backend_02"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "blue",
              "mode": "fixed"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "web_server_01"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "#EF843C",
              "mode": "fixed"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "web_server_02"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "#EAB839",
              "mode": "fixed"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "web_server_03"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "#508642",
              "mode": "fixed"
            }
          }
        ]
      },
      {
        "matcher": {
          "id": "byName",
          "options": "web_server_04"
        },
        "properties": [
          {
            "id": "color",
            "value": {
              "fixedColor": "#E24D42",
              "mode": "fixed"
            }
          }
        ]
      }
    ]
  },
  "gridPos": {
    "h": 7,
    "w": 18,
    "x": 0,
    "y": 2
  },
  "id": 1,
  "maxDataPoints": 400,
  "options": {
    "tooltip": {
      "mode": "multi",
      "sort": "none"
    },
    "legend": {
      "showLegend": true,
      "displayMode": "list",
      "placement": "right",
      "calcs": []
    }
  },
  "pluginVersion": "8.0.0-beta1",
  "targets": [
    {
      "datasource": {
        "type": "graphite",
        "uid": "000000001"
      },
      "refCount": 0,
      "refId": "A",
      "target": "aliasByNode(scaleToSeconds(apps.backend.backend_01.counters.requests.count, 1), 2)",
      "textEditor": false
    },
    {
      "datasource": {
        "type": "graphite",
        "uid": "000000001"
      },
      "hide": false,
      "refCount": 0,
      "refId": "B",
      "target": "aliasByNode(scaleToSeconds(apps.backend.backend_02.counters.requests.count, 2), 2)"
    }
  ],
  "title": "Simple graph",
  "type": "timeseries"
}

Your issue is kinda weird…

In your first example:
image

This panel is a lot smaller than your example from the demo.

The really weird thing is, if I reduce the size of the demo panel, I got:
image

Which is not the same as you… So I’m not gonna be able to help you furthermore :neutral_face:. You’re gonna have to wait for someone better with Grafana than me!

Regards

1 Like