Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8108593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:09:41+00:00 2026-06-06T01:09:41+00:00

I have 6 graph bars with the prices. Each price number will represent its

  • 0

I have 6 graph bars with the prices.
Each price number will represent its graphbar’s height by respecting min and max heights.
What i want is that graph bar’s height wouldn’t go below or above the min and the max value.

So i have values of min = 55 and max = 110.
And price numbers are:

  1. 49
  2. 212
  3. 717
  4. 1081
  5. 93

By which mathematical algorithm I could achieve expected results ?
It’s some sort of dynamic scalable bar graphs.

Modified
So the min and max values from the price list will be: 49(min price) => 55(min) and 1081 (max price) => 110(max)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:09:45+00:00Added an answer on June 6, 2026 at 1:09 am

    The solution is simple:

    • Pick the smallest, and largest item and find the difference.
    • (largest_item – smallest_item) maps to (max-min).
    • Compute ratio = (max-min)/(largest_item-smallest_item)
    • final_value = min_value + ratio*(value-smallest_item)

    As a mathematical function:

    f(x,max,min,largest,smallest) = min + (max-min)/(largest-smallest)*(x-smallest)
    where:
    x : Input item's price
    max: Maximum value (here, 110)
    min: Minimum value (here, 55)
    largest: Largest item in input (Here, 1081)
    smallest: Smallest item in input (Here, 49)
    

    One check, as @amit correctly points out: Ensure largest and smallest item are distinct.


    So let x = 93. We have other 4 values with us.

    f(x,max,min,largest,smallest) = min + (max-min)/(largest-smallest)*(x-smallest)
    
    value = 55  +   ((110-55)/(1081-49)) * (93-49)
    value = 57.344961
    

    Further,

    f(93,110,55,1081,49) = 57.344961
    f(49,110,55,1081,49) = 55
    f(1081,110,55,1081,49) = 110
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a graph which contains an unknown number of disconnected subgraphs. What's a
I have a bar graph using html and css, I am using height to
I have this jqplot bar graph. The current display of the bars are shown
I have two graph in my program each one can control a USB camera
I have a code in excel to change colors of bar graph but its
I have a graph which I would like to represent using an image on
I'm using core-plot0.4 for drawing waterfall graph. I have used barFillForBarPlot for coloring bars,
I have a graph (organigram) how this: digraph G { nodesep=0.3; ranksep=0.2; margin=0.1; node
I have a graph, well, a series of disconnected graphs in Neo4j. I want
I have a graph with n nodes as an adjacency matrix . Is it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.